Introduction
IBM Watson™ Discovery v1 is a cognitive search and content analytics engine that you can add to applications to identify patterns, trends and actionable insights to drive better decision-making. Securely unify structured and unstructured data with pre-enriched content, and use a simplified query language to eliminate the need for manual filtering of results.
This documentation describes Java SDK major version 9. For more information about how to update your code from the previous version, see the migration guide.
This documentation describes Node SDK major version 6. For more information about how to update your code from the previous version, see the migration guide.
This documentation describes Python SDK major version 5. For more information about how to update your code from the previous version, see the migration guide.
This documentation describes Ruby SDK major version 2. For more information about how to update your code from the previous version, see the migration guide.
This documentation describes .NET Standard SDK major version 5. For more information about how to update your code from the previous version, see the migration guide.
This documentation describes Go SDK major version 2. For more information about how to update your code from the previous version, see the migration guide.
This documentation describes Swift SDK major version 4. For more information about how to update your code from the previous version, see the migration guide.
This documentation describes Unity SDK major version 5. For more information about how to update your code from the previous version, see the migration guide.
Discovery v1 is deprecated. As of 11 July 2023, you cannot create new instances. Existing Advanced plan instances are supported until 11 July 2023. Any instances that still exist on that date will be deleted. For more information about Discovery v2, see the v2 API. For more information about how to migrate to Discovery v2, see Getting the most from Discovery.
Discovery v1 is deprecated. As of 11 July 2023, you cannot create new instances. Existing Advanced plan instances are supported until 11 July 2023. Any instances that still exist on that date will be deleted. For more information about Discovery v2, see the v2 API. For more information about how to migrate to Discovery v2, see Getting the most from Discovery.
Discovery v1 is deprecated. As of 11 July 2023, you cannot create new instances. Existing Advanced plan instances are supported until 11 July 2023. Any instances that still exist on that date will be deleted. For more information about Discovery v2, see the v2 API. For more information about how to migrate to Discovery v2, see Getting the most from Discovery.
Discovery v1 is deprecated. As of 11 July 2023, you cannot create new instances. Existing Advanced plan instances are supported until 11 July 2023. Any instances that still exist on that date will be deleted. For more information about Discovery v2, see the v2 API. For more information about how to migrate to Discovery v2, see Getting the most from Discovery.
Discovery v1 is deprecated. As of 11 July 2023, you cannot create new instances. Existing Advanced plan instances are supported until 11 July 2023. Any instances that still exist on that date will be deleted. For more information about Discovery v2, see the v2 API. For more information about how to migrate to Discovery v2, see Getting the most from Discovery.
The IBM Watson Unity SDK has the following requirements.
- The SDK requires Unity version 2018.2 or later to support Transport Layer Security (TLS) 1.2.
- Set the project settings for both the Scripting Runtime Version and the Api Compatibility Level to
.NET 4.x Equivalent
. - For more information, see TLS 1.0 support.
- Set the project settings for both the Scripting Runtime Version and the Api Compatibility Level to
- The SDK doesn't support the WebGL projects. Change your build settings to any platform except
WebGL
.
For more information about how to install and configure the SDK and SDK Core, see https://github.com/watson-developer-cloud/unity-sdk.
The code examples on this tab use the client library that is provided for Java.
Maven
<dependency>
<groupId>com.ibm.watson</groupId>
<artifactId>ibm-watson</artifactId>
<version>11.0.0</version>
</dependency>
Gradle
compile 'com.ibm.watson:ibm-watson:11.0.0'
GitHub
The code examples on this tab use the client library that is provided for Node.js.
Installation
npm install ibm-watson@^8.0.0
GitHub
The code examples on this tab use the client library that is provided for Python.
Installation
pip install --upgrade "ibm-watson>=7.0.0"
GitHub
The code examples on this tab use the client library that is provided for Ruby.
Installation
gem install ibm_watson
GitHub
The code examples on this tab use the client library that is provided for Go.
go get -u github.com/watson-developer-cloud/go-sdk/v2@v3.0.0
GitHub
The code examples on this tab use the client library that is provided for Swift.
Cocoapods
pod 'IBMWatsonDiscoveryV1', '~> 5.0.0'
Carthage
github "watson-developer-cloud/swift-sdk" ~> 5.0.0
Swift Package Manager
.package(url: "https://github.com/watson-developer-cloud/swift-sdk", from: "5.0.0")
GitHub
The code examples on this tab use the client library that is provided for .NET Standard.
Package Manager
Install-Package IBM.Watson.Discovery.v1 -Version 7.0.0
.NET CLI
dotnet add package IBM.Watson.Discovery.v1 --version 7.0.0
PackageReference
<PackageReference Include="IBM.Watson.Discovery.v1" Version="7.0.0" />
GitHub
The code examples on this tab use the client library that is provided for Unity.
GitHub
IBM Cloud URLs
The base URLs come from the service instance. To find the URL, view the service credentials by clicking the name of the service in the Resource list. Use the value of the URL. Add the method to form the complete API endpoint for your request.
The following example URL represents a Discovery instance that is hosted in Washington DC:
https://api.us-east.discovery.watson.cloud.ibm.com/instances/6bbda3b3-d572-45e1-8c54-22d6ed9e52c2
The following URLs represent the base URLs for Discovery. When you call the API, use the URL that corresponds to the location of your service instance.
- Dallas:
https://api.us-south.discovery.watson.cloud.ibm.com
- Washington DC:
https://api.us-east.discovery.watson.cloud.ibm.com
- Frankfurt:
https://api.eu-de.discovery.watson.cloud.ibm.com
- Sydney:
https://api.au-syd.discovery.watson.cloud.ibm.com
- Tokyo:
https://api.jp-tok.discovery.watson.cloud.ibm.com
- London:
https://api.eu-gb.discovery.watson.cloud.ibm.com
- Seoul:
https://api.kr-seo.discovery.watson.cloud.ibm.com
Set the correct service URL by calling the setServiceUrl()
method of the service instance.
Set the correct service URL by specifying the serviceUrl
parameter when you create the service instance.
Set the correct service URL by calling the set_service_url()
method of the service instance.
Set the correct service URL by specifying the service_url
property of the service instance.
Set the correct service URL by calling the SetServiceURL()
method of the service instance.
Set the correct service URL by setting the serviceURL
property of the service instance.
Set the correct service URL by calling the SetServiceUrl()
method of the service instance.
Set the correct service URL by calling the SetServiceUrl()
method of the service instance.
Dallas API endpoint example for services managed on IBM Cloud
curl -X {request_method} -u "apikey:{apikey}" "https://api.us-south.discovery.watson.cloud.ibm.com/instances/{instance_id}"
Your service instance might not use this URL
Default URL
https://api.us-south.discovery.watson.cloud.ibm.com
Example for the Washington DC location
IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
Discovery discovery = new Discovery("{version}", authenticator);
discovery.setServiceUrl("https://api.us-east.discovery.watson.cloud.ibm.com");
Default URL
https://api.us-south.discovery.watson.cloud.ibm.com
Example for the Washington DC location
const DiscoveryV1 = require('ibm-watson/discovery/v1');
const { IamAuthenticator } = require('ibm-watson/auth');
const discovery = new DiscoveryV1({
version: '{version}',
authenticator: new IamAuthenticator({
apikey: '{apikey}',
}),
serviceUrl: 'https://api.us-east.discovery.watson.cloud.ibm.com',
});
Default URL
https://api.us-south.discovery.watson.cloud.ibm.com
Example for the Washington DC location
from ibm_watson import DiscoveryV1
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
authenticator = IAMAuthenticator('{apikey}')
discovery = DiscoveryV1(
version='{version}',
authenticator=authenticator
)
discovery.set_service_url('https://api.us-east.discovery.watson.cloud.ibm.com')
Default URL
https://api.us-south.discovery.watson.cloud.ibm.com
Example for the Washington DC location
require "ibm_watson/authenticators"
require "ibm_watson/discovery_v1"
include IBMWatson
authenticator = Authenticators::IamAuthenticator.new(
apikey: "{apikey}"
)
discovery = DiscoveryV1.new(
version: "{version}",
authenticator: authenticator
)
discovery.service_url = "https://api.us-east.discovery.watson.cloud.ibm.com"
Default URL
https://api.us-south.discovery.watson.cloud.ibm.com
Example for the Washington DC location
discovery, discoveryErr := discoveryv1.NewDiscoveryV1(options)
if discoveryErr != nil {
panic(discoveryErr)
}
discovery.SetServiceURL("https://api.us-east.discovery.watson.cloud.ibm.com")
Default URL
https://api.us-south.discovery.watson.cloud.ibm.com
Example for the Washington DC location
let authenticator = WatsonIAMAuthenticator(apiKey: "{apikey}")
let discovery = Discovery(version: "{version}", authenticator: authenticator)
discovery.serviceURL = "https://api.us-east.discovery.watson.cloud.ibm.com"
Default URL
https://api.us-south.discovery.watson.cloud.ibm.com
Example for the Washington DC location
IamAuthenticator authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
DiscoveryService discovery = new DiscoveryService("{version}", authenticator);
discovery.SetServiceUrl("https://api.us-east.discovery.watson.cloud.ibm.com");
Default URL
https://api.us-south.discovery.watson.cloud.ibm.com
Example for the Washington DC location
var authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
while (!authenticator.CanAuthenticate())
yield return null;
var discovery = new DiscoveryService("{version}", authenticator);
discovery.SetServiceUrl("https://api.us-east.discovery.watson.cloud.ibm.com");
Disabling SSL verification
All Watson services use Secure Sockets Layer (SSL) (or Transport Layer Security (TLS)) for secure connections between the client and server. The connection is verified against the local certificate store to ensure authentication, integrity, and confidentiality.
If you use a self-signed certificate, you need to disable SSL verification to make a successful connection.
Enabling SSL verification is highly recommended. Disabling SSL jeopardizes the security of the connection and data. Disable SSL only if necessary, and take steps to enable SSL as soon as possible.
To disable SSL verification for a curl request, use the --insecure
(-k
) option with the request.
To disable SSL verification, create an HttpConfigOptions
object and set the disableSslVerification
property to true
. Then, pass the object to the service instance by using the configureClient
method.
To disable SSL verification, set the disableSslVerification
parameter to true
when you create the service instance.
To disable SSL verification, specify True
on the set_disable_ssl_verification
method for the service instance.
To disable SSL verification, set the disable_ssl_verification
parameter to true
in the configure_http_client()
method for the service instance.
To disable SSL verification, call the DisableSSLVerification
method on the service instance.
To disable SSL verification, call the disableSSLVerification()
method on the service instance. You cannot disable SSL verification on Linux.
To disable SSL verification, set the DisableSslVerification
method to true
on the service instance.
To disable SSL verification, set the DisableSslVerification
method to true
on the service instance.
Example to disable SSL verification. Replace {apikey}
and {url}
with your service credentials.
curl -k -X {request_method} -u "apikey:{apikey}" "{url}/{method}"
Example to disable SSL verification
IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
Discovery discovery = new Discovery("{version}", authenticator);
discovery.setServiceUrl("{url}");
HttpConfigOptions configOptions = new HttpConfigOptions.Builder()
.disableSslVerification(true)
.build();
discovery.configureClient(configOptions);
Example to disable SSL verification
const DiscoveryV1 = require('ibm-watson/discovery/v1');
const { IamAuthenticator } = require('ibm-watson/auth');
const discovery = new DiscoveryV1({
version: '{version}',
authenticator: new IamAuthenticator({
apikey: '{apikey}',
}),
serviceUrl: '{url}',
disableSslVerification: true,
});
Example to disable SSL verification
from ibm_watson import DiscoveryV1
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
authenticator = IAMAuthenticator('{apikey}')
discovery = DiscoveryV1(
version='{version}',
authenticator=authenticator
)
discovery.set_service_url('{url}')
discovery.set_disable_ssl_verification(True)
Example to disable SSL verification
require "ibm_watson/authenticators"
require "ibm_watson/discovery_v1"
include IBMWatson
authenticator = Authenticators::IamAuthenticator.new(
apikey: "{apikey}"
)
discovery = DiscoveryV1.new(
version: "{version}",
authenticator: authenticator
)
discovery.service_url = "{url}"
discovery.configure_http_client(disable_ssl_verification: true)
Example to disable SSL verification
discovery, discoveryErr := discoveryv1.NewDiscoveryV1(options)
if discoveryErr != nil {
panic(discoveryErr)
}
discovery.SetServiceURL("{url}")
discovery.DisableSSLVerification()
Example to disable SSL verification
let authenticator = WatsonIAMAuthenticator(apiKey: "{apikey}")
let discovery = Discovery(version: "{version}", authenticator: authenticator)
discovery.serviceURL = "{url}"
discovery.disableSSLVerification()
Example to disable SSL verification
IamAuthenticator authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
DiscoveryService discovery = new DiscoveryService("{version}", authenticator);
discovery.SetServiceUrl("{url}");
discovery.DisableSslVerification(true);
Example to disable SSL verification
var authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
while (!authenticator.CanAuthenticate())
yield return null;
var discovery = new DiscoveryService("{version}", authenticator);
discovery.SetServiceUrl("{url}");
discovery.DisableSslVerification = true;
Authentication
You authenticate to the API by using IBM Cloud Identity and Access Management (IAM).
You can pass either a bearer token in an authorization header or an API key. Tokens support authenticated requests without embedding service credentials in every call. API keys use basic authentication. For more information, see Authenticating to Watson services.
- For testing and development, you can pass an API key directly.
- For production use, unless you use the Watson SDKs, use an IAM token.
If you pass in an API key, use apikey
for the username and the value of the API key as the password. For example, if the API key is f5sAznhrKQyvBFFaZbtF60m5tzLbqWhyALQawBg5TjRI
in the service credentials, include the credentials in your call like this:
curl -u "apikey:f5sAznhrKQyvBFFaZbtF60m5tzLbqWhyALQawBg5TjRI"
For IBM Cloud instances, the SDK provides initialization methods for each form of authentication.
- Use the API key to have the SDK manage the lifecycle of the access token. The SDK requests an access token, ensures that the access token is valid, and refreshes it if necessary.
- Use the access token to manage the lifecycle yourself. You must periodically refresh the token.
For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.
Replace {apikey}
and {url}
with your service credentials.
curl -X {request_method} -u "apikey:{apikey}" "{url}/v1/{method}"
SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
Discovery discovery = new Discovery("{version}", authenticator);
discovery.setServiceUrl("{url}");
SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
const DiscoveryV1 = require('ibm-watson/discovery/v1');
const { IamAuthenticator } = require('ibm-watson/auth');
const discovery = new DiscoveryV1({
version: '{version}',
authenticator: new IamAuthenticator({
apikey: '{apikey}',
}),
serviceUrl: '{url}',
});
SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
from ibm_watson import DiscoveryV1
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
authenticator = IAMAuthenticator('{apikey}')
discovery = DiscoveryV1(
version='{version}',
authenticator=authenticator
)
discovery.set_service_url('{url}')
SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
require "ibm_watson/authenticators"
require "ibm_watson/discovery_v1"
include IBMWatson
authenticator = Authenticators::IamAuthenticator.new(
apikey: "{apikey}"
)
discovery = DiscoveryV1.new(
version: "{version}",
authenticator: authenticator
)
discovery.service_url = "{url}"
SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
import (
"github.com/IBM/go-sdk-core/core"
"github.com/watson-developer-cloud/go-sdk/discoveryv1"
)
func main() {
authenticator := &core.IamAuthenticator{
ApiKey: "{apikey}",
}
options := &discoveryv1.DiscoveryV1Options{
Version: "{version}",
Authenticator: authenticator,
}
discovery, discoveryErr := discoveryv1.NewDiscoveryV1(options)
if discoveryErr != nil {
panic(discoveryErr)
}
discovery.SetServiceURL("{url}")
}
SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
let authenticator = WatsonIAMAuthenticator(apiKey: "{apikey}")
let discovery = Discovery(version: "{version}", authenticator: authenticator)
discovery.serviceURL = "{url}"
SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
IamAuthenticator authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
DiscoveryService discovery = new DiscoveryService("{version}", authenticator);
discovery.SetServiceUrl("{url}");
SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
var authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
while (!authenticator.CanAuthenticate())
yield return null;
var discovery = new DiscoveryService("{version}", authenticator);
discovery.SetServiceUrl("{url}");
Access between services
Your application might use more than one Watson service. You can grant access between services and you can grant access to more than one service for your applications.
For IBM Cloud services, the method to grant access between Watson services varies depending on the type of API key. For more information, see IAM access.
- To grant access between IBM Cloud services, create an authorization between the services. For more information, see Granting access between services.
- To grant access to your services by applications without using user credentials, create a service ID, add an API key, and assign access policies. For more information, see Creating and working with service IDs.
When you give a user ID access to multiple services, use an endpoint URL that includes the service instance ID (for example, https://api.us-south.discovery.watson.cloud.ibm.com/instances/6bbda3b3-d572-45e1-8c54-22d6ed9e52c2
). You can find the instance ID in two places:
-
By clicking the service instance row in the Resource list. The instance ID is the GUID in the details pane.
-
By clicking the name of the service instance in the list and looking at the credentials URL.
If you don't see the instance ID in the URL, the credentials predate service IDs. Add new credentials from the Service credentials page and use those credentials.
Versioning
API requests require a version parameter that takes a date in the format version=YYYY-MM-DD
. When the API is updated with any breaking changes, the service introduces a new version date for the API.
Send the version parameter with every API request. The service uses the API version for the date you specify, or the most recent version before that date. Don't default to the current date. Instead, specify a date that matches a version that is compatible with your app, and don't change it until your app is ready for a later version.
Specify the version to use on API requests with the version parameter when you create the service instance. The service uses the API version for the date you specify, or the most recent version before that date. Don't default to the current date. Instead, specify a date that matches a version that is compatible with your app, and don't change it until your app is ready for a later version.
This documentation describes the current version of Discovery, 2019-04-30
. In some cases, differences in earlier versions are noted in the descriptions of parameters and response models.
Error handling
Discovery uses standard HTTP response codes to indicate whether a method completed successfully. HTTP response codes in the 2xx range indicate success. A response in the 4xx range is some sort of failure, and a response in the 5xx range usually indicates an internal system error that cannot be resolved by the user. Response codes are listed with the method.
ErrorResponse
Name | Description |
---|---|
code integer |
The HTTP response code. |
error string |
General description of an error. |
The Java SDK generates an exception for any unsuccessful method invocation. All methods that accept an argument can also throw an IllegalArgumentException
.
Exception | Description |
---|---|
IllegalArgumentException | An invalid argument was passed to the method. |
When the Java SDK receives an error response from the Discovery service, it generates an exception from the com.ibm.watson.developer_cloud.service.exception
package. All service exceptions contain the following fields.
Field | Description |
---|---|
statusCode | The HTTP response code that is returned. |
message | A message that describes the error. |
When the Node SDK receives an error response from the Discovery service, it creates an Error
object with information that describes the error that occurred. This error object is passed as the first parameter to the callback function for the method. The contents of the error object are as shown in the following table.
Error
Field | Description |
---|---|
code | The HTTP response code that is returned. |
message | A message that describes the error. |
The Python SDK generates an exception for any unsuccessful method invocation. When the Python SDK receives an error response from the Discovery service, it generates an ApiException
with the following fields.
Field | Description |
---|---|
code | The HTTP response code that is returned. |
message | A message that describes the error. |
info | A dictionary of additional information about the error. |
When the Ruby SDK receives an error response from the Discovery service, it generates an ApiException
with the following fields.
Field | Description |
---|---|
code | The HTTP response code that is returned. |
message | A message that describes the error. |
info | A dictionary of additional information about the error. |
The Go SDK generates an error for any unsuccessful service instantiation and method invocation. You can check for the error immediately. The contents of the error object are as shown in the following table.
Error
Field | Description |
---|---|
code | The HTTP response code that is returned. |
message | A message that describes the error. |
The Swift SDK returns a WatsonError
in the completionHandler
any unsuccessful method invocation. This error type is an enum that conforms to LocalizedError
and contains an errorDescription
property that returns an error message. Some of the WatsonError
cases contain associated values that reveal more information about the error.
Field | Description |
---|---|
errorDescription | A message that describes the error. |
When the .NET Standard SDK receives an error response from the Discovery service, it generates a ServiceResponseException
with the following fields.
Field | Description |
---|---|
Message | A message that describes the error. |
CodeDescription | The HTTP response code that is returned. |
When the Unity SDK receives an error response from the Discovery service, it generates an IBMError
with the following fields.
Field | Description |
---|---|
Url | The URL that generated the error. |
StatusCode | The HTTP response code returned. |
ErrorMessage | A message that describes the error. |
Response | The contents of the response from the server. |
ResponseHeaders | A dictionary of headers returned by the request. |
Example error handling
try {
// Invoke a method
} catch (NotFoundException e) {
// Handle Not Found (404) exception
} catch (RequestTooLargeException e) {
// Handle Request Too Large (413) exception
} catch (ServiceResponseException e) {
// Base class for all exceptions caused by error responses from the service
System.out.println("Service returned status code "
+ e.getStatusCode() + ": " + e.getMessage());
}
Example error handling
discovery.method(params)
.catch(err => {
console.log('error:', err);
});
Example error handling
from ibm_watson import ApiException
try:
# Invoke a method
except ApiException as ex:
print "Method failed with status code " + str(ex.code) + ": " + ex.message
Example error handling
require "ibm_watson"
begin
# Invoke a method
rescue IBMWatson::ApiException => ex
print "Method failed with status code #{ex.code}: #{ex.error}"
end
Example error handling
import "github.com/watson-developer-cloud/go-sdk/discoveryv1"
// Instantiate a service
discovery, discoveryErr := discoveryv1.NewDiscoveryV1(options)
// Check for errors
if discoveryErr != nil {
panic(discoveryErr)
}
// Call a method
result, _, responseErr := discovery.MethodName(&methodOptions)
// Check for errors
if responseErr != nil {
panic(responseErr)
}
Example error handling
discovery.method() {
response, error in
if let error = error {
switch error {
case let .http(statusCode, message, metadata):
switch statusCode {
case .some(404):
// Handle Not Found (404) exception
print("Not found")
case .some(413):
// Handle Request Too Large (413) exception
print("Payload too large")
default:
if let statusCode = statusCode {
print("Error - code: \(statusCode), \(message ?? "")")
}
}
default:
print(error.localizedDescription)
}
return
}
guard let result = response?.result else {
print(error?.localizedDescription ?? "unknown error")
return
}
print(result)
}
Example error handling
try
{
// Invoke a method
}
catch(ServiceResponseException e)
{
Console.WriteLine("Error: " + e.Message);
}
catch (Exception e)
{
Console.WriteLine("Error: " + e.Message);
}
Example error handling
// Invoke a method
discovery.MethodName(Callback, Parameters);
// Check for errors
private void Callback(DetailedResponse<ExampleResponse> response, IBMError error)
{
if (error == null)
{
Log.Debug("ExampleCallback", "Response received: {0}", response.Response);
}
else
{
Log.Debug("ExampleCallback", "Error received: {0}, {1}, {3}", error.StatusCode, error.ErrorMessage, error.Response);
}
}
Additional headers
Some Watson services accept special parameters in headers that are passed with the request.
You can pass request header parameters in all requests or in a single request to the service.
To pass a request header, use the --header
(-H
) option with a curl request.
To pass header parameters with every request, use the setDefaultHeaders
method of the service object. See Data collection for an example use of this method.
To pass header parameters in a single request, use the addHeader
method as a modifier on the request before you execute it.
To pass header parameters with every request, specify the headers
parameter when you create the service object. See Data collection for an example use of this method.
To pass header parameters in a single request, use the headers
method as a modifier on the request before you execute it.
To pass header parameters with every request, specify the set_default_headers
method of the service object. See Data collection for an example use of this method.
To pass header parameters in a single request, include headers
as a dict
in the request.
To pass header parameters with every request, specify the add_default_headers
method of the service object. See Data collection for an example use of this method.
To pass header parameters in a single request, specify the headers
method as a chainable method in the request.
To pass header parameters with every request, specify the SetDefaultHeaders
method of the service object. See Data collection for an example use of this method.
To pass header parameters in a single request, specify the Headers
as a map
in the request.
To pass header parameters with every request, add them to the defaultHeaders
property of the service object. See Data collection for an example use of this method.
To pass header parameters in a single request, pass the headers
parameter to the request method.
To pass header parameters in a single request, use the WithHeader()
method as a modifier on the request before you execute it. See Data collection for an example use of this method.
To pass header parameters in a single request, use the WithHeader()
method as a modifier on the request before you execute it.
Example header parameter in a request
curl -X {request_method} -H "Request-Header: {header_value}" "{url}/v1/{method}"
Example header parameter in a request
ReturnType returnValue = discovery.methodName(parameters)
.addHeader("Custom-Header", "{header_value}")
.execute();
Example header parameter in a request
const parameters = {
{parameters}
};
discovery.methodName(
parameters,
headers: {
'Custom-Header': '{header_value}'
})
.then(result => {
console.log(response);
})
.catch(err => {
console.log('error:', err);
});
Example header parameter in a request
response = discovery.methodName(
parameters,
headers = {
'Custom-Header': '{header_value}'
})
Example header parameter in a request
response = discovery.headers(
"Custom-Header" => "{header_value}"
).methodName(parameters)
Example header parameter in a request
result, _, responseErr := discovery.MethodName(
&methodOptions{
Headers: map[string]string{
"Accept": "application/json",
},
},
)
Example header parameter in a request
let customHeader: [String: String] = ["Custom-Header": "{header_value}"]
discovery.methodName(parameters, headers: customHeader) {
response, error in
}
Example header parameter in a request
IamAuthenticator authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
DiscoveryService discovery = new DiscoveryService("{version}", authenticator);
discovery.SetServiceUrl("{url}");
discovery.WithHeader("Custom-Header", "header_value");
Example header parameter in a request
var authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
while (!authenticator.CanAuthenticate())
yield return null;
var discovery = new DiscoveryService("{version}", authenticator);
discovery.SetServiceUrl("{url}");
discovery.WithHeader("Custom-Header", "header_value");
Response details
The Discovery service might return information to the application in response headers.
To access all response headers that the service returns, include the --include
(-i
) option with a curl request. To see detailed response data for the request, including request headers, response headers, and extra debugging information, include the --verbose
(-v
) option with the request.
Example request to access response headers
curl -X {request_method} {authentication_method} --include "{url}/v1/{method}"
To access information in the response headers, use one of the request methods that returns details with the response: executeWithDetails()
, enqueueWithDetails()
, or rxWithDetails()
. These methods return a Response<T>
object, where T
is the expected response model. Use the getResult()
method to access the response object for the method, and use the getHeaders()
method to access information in response headers.
Example request to access response headers
Response<ReturnType> response = discovery.methodName(parameters)
.executeWithDetails();
// Access response from methodName
ReturnType returnValue = response.getResult();
// Access information in response headers
Headers responseHeaders = response.getHeaders();
All response data is available in the Response<T>
object that is returned by each method. To access information in the response
object, use the following properties.
Property | Description |
---|---|
result |
Returns the response for the service-specific method. |
headers |
Returns the response header information. |
status |
Returns the HTTP status code. |
Example request to access response headers
discovery.methodName(parameters)
.then(response => {
console.log(response.headers);
})
.catch(err => {
console.log('error:', err);
});
The return value from all service methods is a DetailedResponse
object. To access information in the result object or response headers, use the following methods.
DetailedResponse
Method | Description |
---|---|
get_result() |
Returns the response for the service-specific method. |
get_headers() |
Returns the response header information. |
get_status_code() |
Returns the HTTP status code. |
Example request to access response headers
discovery.set_detailed_response(True)
response = discovery.methodName(parameters)
# Access response from methodName
print(json.dumps(response.get_result(), indent=2))
# Access information in response headers
print(response.get_headers())
# Access HTTP response status
print(response.get_status_code())
The return value from all service methods is a DetailedResponse
object. To access information in the response
object, use the following properties.
DetailedResponse
Property | Description |
---|---|
result |
Returns the response for the service-specific method. |
headers |
Returns the response header information. |
status |
Returns the HTTP status code. |
Example request to access response headers
response = discovery.methodName(parameters)
# Access response from methodName
print response.result
# Access information in response headers
print response.headers
# Access HTTP response status
print response.status
The return value from all service methods is a DetailedResponse
object. To access information in the response
object or response headers, use the following methods.
DetailedResponse
Method | Description |
---|---|
GetResult() |
Returns the response for the service-specific method. |
GetHeaders() |
Returns the response header information. |
GetStatusCode() |
Returns the HTTP status code. |
Example request to access response headers
import (
"github.com/IBM/go-sdk-core/core"
"github.com/watson-developer-cloud/go-sdk/discoveryv1"
)
result, response, responseErr := discovery.MethodName(
&methodOptions{})
// Access result
core.PrettyPrint(response.GetResult(), "Result ")
// Access response headers
core.PrettyPrint(response.GetHeaders(), "Headers ")
// Access status code
core.PrettyPrint(response.GetStatusCode(), "Status Code ")
All response data is available in the WatsonResponse<T>
object that is returned in each method's completionHandler
.
Example request to access response headers
discovery.methodName(parameters) {
response, error in
guard let result = response?.result else {
print(error?.localizedDescription ?? "unknown error")
return
}
print(result) // The data returned by the service
print(response?.statusCode)
print(response?.headers)
}
The response contains fields for response headers, response JSON, and the status code.
DetailedResponse
Property | Description |
---|---|
Result |
Returns the result for the service-specific method. |
Response |
Returns the raw JSON response for the service-specific method. |
Headers |
Returns the response header information. |
StatusCode |
Returns the HTTP status code. |
Example request to access response headers
var results = discovery.MethodName(parameters);
var result = results.Result; // The result object
var responseHeaders = results.Headers; // The response headers
var responseJson = results.Response; // The raw response JSON
var statusCode = results.StatusCode; // The response status code
The response contains fields for response headers, response JSON, and the status code.
DetailedResponse
Property | Description |
---|---|
Result |
Returns the result for the service-specific method. |
Response |
Returns the raw JSON response for the service-specific method. |
Headers |
Returns the response header information. |
StatusCode |
Returns the HTTP status code. |
Example request to access response headers
private void Example()
{
discovery.MethodName(Callback, Parameters);
}
private void Callback(DetailedResponse<ResponseType> response, IBMError error)
{
var result = response.Result; // The result object
var responseHeaders = response.Headers; // The response headers
var responseJson = reresponsesults.Response; // The raw response JSON
var statusCode = response.StatusCode; // The response status code
}
Data labels
You can remove data associated with a specific customer if you label the data with a customer ID when you send a request to the service.
-
Use the
X-Watson-Metadata
header to associate a customer ID with the data. By adding a customer ID to a request, you indicate that it contains data that belongs to that customer.Specify a random or generic string for the customer ID. Do not include personal data, such as an email address. Pass the string
customer_id={id}
as the argument of the header.Labeling data is used only by methods that accept customer data.
-
Use the Delete labeled data method to remove data that is associated with a customer ID.
Use this process of labeling and deleting data only when you want to remove the data that is associated with a single customer, not when you want to remove data for multiple customers. For more information about Discovery and labeling data, see Information security.
For more information about how to pass headers, see Additional headers.
Data collection
By default, Discovery service instances that are not part of Premium plans collect data about API requests and their results. This data is collected only to improve the services for future users. The collected data is not shared or made public. Data is not collected for services that are part of Premium plans.
To prevent IBM usage of your data for an API request, set the X-Watson-Learning-Opt-Out header parameter to true
. You can also disable request logging at the account level. For more information, see Controlling request logging for Watson services.
You must set the header on each request that you do not want IBM to access for general service improvements.
You can set the header by using the setDefaultHeaders
method of the service object.
You can set the header by using the headers
parameter when you create the service object.
You can set the header by using the set_default_headers
method of the service object.
You can set the header by using the add_default_headers
method of the service object.
You can set the header by using the SetDefaultHeaders
method of the service object.
You can set the header by adding it to the defaultHeaders
property of the service object.
You can set the header by using the WithHeader()
method of the service object.
Example request
curl -u "apikey:{apikey}" -H "X-Watson-Learning-Opt-Out: true" "{url}/{method}"
Example request
Map<String, String> headers = new HashMap<String, String>();
headers.put("X-Watson-Learning-Opt-Out", "true");
discovery.setDefaultHeaders(headers);
Example request
const DiscoveryV1 = require('ibm-watson/discovery/v1');
const { IamAuthenticator } = require('ibm-watson/auth');
const discovery = new DiscoveryV1({
version: '{version}',
authenticator: new IamAuthenticator({
apikey: '{apikey}',
}),
serviceUrl: '{url}',
headers: {
'X-Watson-Learning-Opt-Out': 'true'
}
});
Example request
discovery.set_default_headers({'x-watson-learning-opt-out': "true"})
Example request
discovery.add_default_headers(headers: {"x-watson-learning-opt-out" => "true"})
Example request
import "net/http"
headers := http.Header{}
headers.Add("x-watson-learning-opt-out", "true")
discovery.SetDefaultHeaders(headers)
Example request
discovery.defaultHeaders["X-Watson-Learning-Opt-Out"] = "true"
Example request
IamAuthenticator authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
DiscoveryService discovery = new DiscoveryService("{version}", authenticator);
discovery.SetServiceUrl("{url}");
discovery.WithHeader("X-Watson-Learning-Opt-Out", "true");
Example request
var authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
while (!authenticator.CanAuthenticate())
yield return null;
var discovery = new DiscoveryService("{version}", authenticator);
discovery.SetServiceUrl("{url}");
discovery.WithHeader("X-Watson-Learning-Opt-Out", "true");
Synchronous and asynchronous requests
The Java SDK supports both synchronous (blocking) and asynchronous (non-blocking) execution of service methods. All service methods implement the ServiceCall interface.
- To call a method synchronously, use the
execute
method of theServiceCall
interface. You can call theexecute
method directly from an instance of the service. - To call a method asynchronously, use the
enqueue
method of theServiceCall
interface to receive a callback when the response arrives. The ServiceCallback interface of the method's argument providesonResponse
andonFailure
methods that you override to handle the callback.
The Ruby SDK supports both synchronous (blocking) and asynchronous (non-blocking) execution of service methods. All service methods implement the Concurrent::Async module. When you use the synchronous or asynchronous methods, an IVar object is returned. You access the DetailedResponse
object by calling ivar_object.value
.
For more information about the Ivar object, see the IVar class docs.
-
To call a method synchronously, either call the method directly or use the
.await
chainable method of theConcurrent::Async
module.Calling a method directly (without
.await
) returns aDetailedResponse
object. -
To call a method asynchronously, use the
.async
chainable method of theConcurrent::Async
module.
You can call the .await
and .async
methods directly from an instance of the service.
Example synchronous request
ReturnType returnValue = discovery.method(parameters).execute();
Example asynchronous request
discovery.method(parameters).enqueue(new ServiceCallback<ReturnType>() {
@Override public void onResponse(ReturnType response) {
. . .
}
@Override public void onFailure(Exception e) {
. . .
}
});
Example synchronous request
response = discovery.method_name(parameters)
or
response = discovery.await.method_name(parameters)
Example asynchronous request
response = discovery.async.method_name(parameters)
Methods
Create an environment
Creates a new environment for private data. An environment must be created before collections can be created.
Note: You can create only one environment for private data per service instance. An attempt to create another environment results in an error.
Creates a new environment for private data. An environment must be created before collections can be created.
Note: You can create only one environment for private data per service instance. An attempt to create another environment results in an error.
Creates a new environment for private data. An environment must be created before collections can be created.
Note: You can create only one environment for private data per service instance. An attempt to create another environment results in an error.
Creates a new environment for private data. An environment must be created before collections can be created.
Note: You can create only one environment for private data per service instance. An attempt to create another environment results in an error.
Creates a new environment for private data. An environment must be created before collections can be created.
Note: You can create only one environment for private data per service instance. An attempt to create another environment results in an error.
POST /v1/environments
ServiceCall<Environment> createEnvironment(CreateEnvironmentOptions createEnvironmentOptions)
createEnvironment(params)
create_environment(
self,
name: str,
*,
description: str = None,
size: str = None,
**kwargs,
) -> DetailedResponse
CreateEnvironment(string name, string description = null, string size = null)
Request
Use the CreateEnvironmentOptions.Builder
to create a CreateEnvironmentOptions
object that contains the parameter values for the createEnvironment
method.
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
An object that defines an environment name and optional description. The fields in this object are not approved for personal information and cannot be deleted based on customer ID.
{
"name": "Example Environment",
"description": "Description of Environment."
}
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Default:
Size of the environment. In the Lite plan the default and only accepted value is
LT
, in all other plans the default isS
Allowable values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]
The createEnvironment options.
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Default:
Size of the environment. In the Lite plan the default and only accepted value is
LT
, in all other plans the default isS
.Allowable values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]
parameters
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Default:
Size of the environment. In the Lite plan the default and only accepted value is
LT
, in all other plans the default isS
.Allowable values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]
parameters
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Default:
Size of the environment. In the Lite plan the default and only accepted value is
LT
, in all other plans the default isS
.Allowable values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]
parameters
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Default:
Size of the environment. In the Lite plan the default and only accepted value is
LT
, in all other plans the default isS
.Allowable values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]
curl -X POST -u "apikey":"{apikey}" -H "Content-Type: application/json" -d '{ "name": "my_environment", "description": "My environment" }' "{url}/v1/environments?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.CreateEnvironment( name: "my_environment", description: "My environment" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentName = "my_environment"; String environmentDesc = "My environment"; CreateEnvironmentOptions.Builder createOptionsBuilder = new CreateEnvironmentOptions.Builder(environmentName); createOptionsBuilder.description(environmentDesc); Environment createResponse = discovery.createEnvironment(createOptionsBuilder.build()).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const createEnvironmentParams = { name: 'my_environment', description: 'My environment', size: 'LT', }; discovery.createEnvironment(createEnvironmentParams) .then(environment => { console.log(JSON.stringify(environment, null, 2)); }) .catch(err => { console.log('error:', err); });
import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') response = discovery.create_environment( name="my_environment", description="My environment" ).get_result() print(json.dumps(response, indent=2))
Response
Details about an environment.
Unique identifier for the environment.
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Creation date of the environment, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
Date of most recent environment update, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
Current status of the environment.
resizing
is displayed when a request to increase the environment size has been made, but is still in the process of being completed.Possible values: [
active
,pending
,maintenance
,resizing
]If
true
, the environment contains read-only collections that are maintained by IBM.Current size of the environment.
Possible values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]The new size requested for this environment. Only returned when the environment status is
resizing
.Note: Querying and indexing can still be performed during an environment upsize.
Details about the resource usage and capacity of the environment.
Information about the Continuous Relevancy Training for this environment.
Details about an environment.
{
"environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
"name": "test_environment",
"description": "Test environment",
"created": "2016-06-16T10:56:54.957Z",
"updated": "2017-05-16T13:56:54.957Z",
"status": "active",
"read_only": false,
"size": "M",
"index_capacity": {
"documents": {
"indexed": 0,
"maximum_allowed": 1000000
},
"disk_usage": {
"used_bytes": 0,
"maximum_allowed_bytes": 85899345920
},
"collections": {
"available": 1,
"maximum_allowed": 4
}
},
"search_status": [
{
"scope": "environment",
"status": "NO_DATA",
"status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
}
]
}
Unique identifier for the environment.
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Creation date of the environment, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Date of most recent environment update, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Current status of the environment.
resizing
is displayed when a request to increase the environment size has been made, but is still in the process of being completed.Possible values: [
active
,pending
,maintenance
,resizing
]If
true
, the environment contains read-only collections that are maintained by IBM.Current size of the environment.
Possible values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]The new size requested for this environment. Only returned when the environment status is
resizing
.Note: Querying and indexing can still be performed during an environment upsize.
Details about the resource usage and capacity of the environment.
- indexCapacity
Summary of the document usage statistics for the environment.
- documents
Number of documents indexed for the environment.
Total number of documents allowed in the environment's capacity.
Summary of the disk usage statistics for the environment.
- diskUsage
Number of bytes within the environment's disk capacity that are currently used to store data.
Total number of bytes available in the environment's disk capacity.
Summary of the collection usage in the environment.
- collections
Number of active collections in the environment.
Total number of collections allowed in the environment.
Information about the Continuous Relevancy Training for this environment.
- searchStatus
Current scope of the training. Always returned as
environment
.The current status of Continuous Relevancy Training for this environment.
Possible values: [
NO_DATA
,INSUFFICENT_DATA
,TRAINING
,TRAINED
,NOT_APPLICABLE
]Long description of the current Continuous Relevancy Training status.
The date stamp of the most recent completed training for this environment.
Details about an environment.
{
"environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
"name": "test_environment",
"description": "Test environment",
"created": "2016-06-16T10:56:54.957Z",
"updated": "2017-05-16T13:56:54.957Z",
"status": "active",
"read_only": false,
"size": "M",
"index_capacity": {
"documents": {
"indexed": 0,
"maximum_allowed": 1000000
},
"disk_usage": {
"used_bytes": 0,
"maximum_allowed_bytes": 85899345920
},
"collections": {
"available": 1,
"maximum_allowed": 4
}
},
"search_status": [
{
"scope": "environment",
"status": "NO_DATA",
"status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
}
]
}
Unique identifier for the environment.
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Creation date of the environment, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Date of most recent environment update, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Current status of the environment.
resizing
is displayed when a request to increase the environment size has been made, but is still in the process of being completed.Possible values: [
active
,pending
,maintenance
,resizing
]If
true
, the environment contains read-only collections that are maintained by IBM.Current size of the environment.
Possible values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]The new size requested for this environment. Only returned when the environment status is
resizing
.Note: Querying and indexing can still be performed during an environment upsize.
Details about the resource usage and capacity of the environment.
- index_capacity
Summary of the document usage statistics for the environment.
- documents
Number of documents indexed for the environment.
Total number of documents allowed in the environment's capacity.
Summary of the disk usage statistics for the environment.
- disk_usage
Number of bytes within the environment's disk capacity that are currently used to store data.
Total number of bytes available in the environment's disk capacity.
Summary of the collection usage in the environment.
- collections
Number of active collections in the environment.
Total number of collections allowed in the environment.
Information about the Continuous Relevancy Training for this environment.
- search_status
Current scope of the training. Always returned as
environment
.The current status of Continuous Relevancy Training for this environment.
Possible values: [
NO_DATA
,INSUFFICENT_DATA
,TRAINING
,TRAINED
,NOT_APPLICABLE
]Long description of the current Continuous Relevancy Training status.
The date stamp of the most recent completed training for this environment.
Details about an environment.
{
"environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
"name": "test_environment",
"description": "Test environment",
"created": "2016-06-16T10:56:54.957Z",
"updated": "2017-05-16T13:56:54.957Z",
"status": "active",
"read_only": false,
"size": "M",
"index_capacity": {
"documents": {
"indexed": 0,
"maximum_allowed": 1000000
},
"disk_usage": {
"used_bytes": 0,
"maximum_allowed_bytes": 85899345920
},
"collections": {
"available": 1,
"maximum_allowed": 4
}
},
"search_status": [
{
"scope": "environment",
"status": "NO_DATA",
"status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
}
]
}
Unique identifier for the environment.
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Creation date of the environment, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Date of most recent environment update, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Current status of the environment.
resizing
is displayed when a request to increase the environment size has been made, but is still in the process of being completed.Possible values: [
active
,pending
,maintenance
,resizing
]If
true
, the environment contains read-only collections that are maintained by IBM.Current size of the environment.
Possible values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]The new size requested for this environment. Only returned when the environment status is
resizing
.Note: Querying and indexing can still be performed during an environment upsize.
Details about the resource usage and capacity of the environment.
- index_capacity
Summary of the document usage statistics for the environment.
- documents
Number of documents indexed for the environment.
Total number of documents allowed in the environment's capacity.
Summary of the disk usage statistics for the environment.
- disk_usage
Number of bytes within the environment's disk capacity that are currently used to store data.
Total number of bytes available in the environment's disk capacity.
Summary of the collection usage in the environment.
- collections
Number of active collections in the environment.
Total number of collections allowed in the environment.
Information about the Continuous Relevancy Training for this environment.
- search_status
Current scope of the training. Always returned as
environment
.The current status of Continuous Relevancy Training for this environment.
Possible values: [
NO_DATA
,INSUFFICENT_DATA
,TRAINING
,TRAINED
,NOT_APPLICABLE
]Long description of the current Continuous Relevancy Training status.
The date stamp of the most recent completed training for this environment.
Details about an environment.
{
"environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
"name": "test_environment",
"description": "Test environment",
"created": "2016-06-16T10:56:54.957Z",
"updated": "2017-05-16T13:56:54.957Z",
"status": "active",
"read_only": false,
"size": "M",
"index_capacity": {
"documents": {
"indexed": 0,
"maximum_allowed": 1000000
},
"disk_usage": {
"used_bytes": 0,
"maximum_allowed_bytes": 85899345920
},
"collections": {
"available": 1,
"maximum_allowed": 4
}
},
"search_status": [
{
"scope": "environment",
"status": "NO_DATA",
"status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
}
]
}
Unique identifier for the environment.
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Creation date of the environment, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Date of most recent environment update, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Current status of the environment.
resizing
is displayed when a request to increase the environment size has been made, but is still in the process of being completed.Possible values: [
active
,pending
,maintenance
,resizing
]If
true
, the environment contains read-only collections that are maintained by IBM.Current size of the environment.
Possible values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]The new size requested for this environment. Only returned when the environment status is
resizing
.Note: Querying and indexing can still be performed during an environment upsize.
Details about the resource usage and capacity of the environment.
- IndexCapacity
Summary of the document usage statistics for the environment.
- Documents
Number of documents indexed for the environment.
Total number of documents allowed in the environment's capacity.
Summary of the disk usage statistics for the environment.
- DiskUsage
Number of bytes within the environment's disk capacity that are currently used to store data.
Total number of bytes available in the environment's disk capacity.
Summary of the collection usage in the environment.
- Collections
Number of active collections in the environment.
Total number of collections allowed in the environment.
Information about the Continuous Relevancy Training for this environment.
- SearchStatus
Current scope of the training. Always returned as
environment
.The current status of Continuous Relevancy Training for this environment.
Possible values: [
NO_DATA
,INSUFFICENT_DATA
,TRAINING
,TRAINED
,NOT_APPLICABLE
]Long description of the current Continuous Relevancy Training status.
The date stamp of the most recent completed training for this environment.
Status Code
Environment successfully added.
Bad request.
{ "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8", "name": "test_environment", "description": "Test environment", "created": "2016-06-16T10:56:54.957Z", "updated": "2017-05-16T13:56:54.957Z", "status": "active", "read_only": false, "size": "M", "index_capacity": { "documents": { "indexed": 0, "maximum_allowed": 1000000 }, "disk_usage": { "used_bytes": 0, "maximum_allowed_bytes": 85899345920 }, "collections": { "available": 1, "maximum_allowed": 4 } }, "search_status": [ { "scope": "environment", "status": "NO_DATA", "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy." } ] }
{ "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8", "name": "test_environment", "description": "Test environment", "created": "2016-06-16T10:56:54.957Z", "updated": "2017-05-16T13:56:54.957Z", "status": "active", "read_only": false, "size": "M", "index_capacity": { "documents": { "indexed": 0, "maximum_allowed": 1000000 }, "disk_usage": { "used_bytes": 0, "maximum_allowed_bytes": 85899345920 }, "collections": { "available": 1, "maximum_allowed": 4 } }, "search_status": [ { "scope": "environment", "status": "NO_DATA", "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy." } ] }
List environments
List existing environments for the service instance.
List existing environments for the service instance.
List existing environments for the service instance.
List existing environments for the service instance.
List existing environments for the service instance.
GET /v1/environments
ServiceCall<ListEnvironmentsResponse> listEnvironments(ListEnvironmentsOptions listEnvironmentsOptions)
listEnvironments(params)
list_environments(
self,
*,
name: str = None,
**kwargs,
) -> DetailedResponse
ListEnvironments(string name = null)
Request
Use the ListEnvironmentsOptions.Builder
to create a ListEnvironmentsOptions
object that contains the parameter values for the listEnvironments
method.
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.Show only the environment with the given name.
The listEnvironments options.
Show only the environment with the given name.
parameters
Show only the environment with the given name.
parameters
Show only the environment with the given name.
parameters
Show only the environment with the given name.
curl -u "apikey":"{apikey}" "{url}/v1/environments?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.ListEnvironments(); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); ListEnvironmentsOptions options = new ListEnvironmentsOptions.Builder().build(); ListEnvironmentsResponse listResponse = discovery.listEnvironments(options).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); discovery.listEnvironments() .then(listEnvironmentsResponse => { console.log(JSON.stringify(listEnvironmentsResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') environments = discovery.list_environments().get_result() print(json.dumps(environments, indent=2)) system_environments = [x for x in environments['environments'] if x['name'] == 'Watson System Environment'] system_environment_id = system_environments[0]['environment_id'] collections = discovery.list_collections(system_environment_id).get_result() system_collections = [x for x in collections['collections']] print(json.dumps(system_collections, indent=2))
Response
Response object containing an array of configured environments.
An array of [environments] that are available for the service instance.
Response object containing an array of configured environments.
{
"environments": [
{
"environment_id": "ecbda78e-fb06-40b1-a43f-a039fac0adc6",
"name": "byod_environment",
"description": "Private Data Environment",
"created": "2017-07-14T12:54:40.985Z",
"updated": "2017-07-14T12:54:40.985Z",
"read_only": false
},
{
"environment_id": "system",
"name": "Watson System Environment",
"description": "Watson System environment",
"created": "2017-07-13T01:14:20.761Z",
"updated": "2017-07-13T01:14:20.761Z",
"read_only": true
}
]
}
An array of [environments] that are available for the service instance.
Examples:{ "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8", "name": "test_environment", "description": "Test environment", "created": "2016-06-16T10:56:54.957Z", "updated": "2017-05-16T13:56:54.957Z", "status": "active", "read_only": false, "size": "M", "index_capacity": { "documents": { "indexed": 0, "maximum_allowed": 1000000 }, "disk_usage": { "used_bytes": 0, "maximum_allowed_bytes": 85899345920 }, "collections": { "available": 1, "maximum_allowed": 4 } }, "search_status": [ { "scope": "environment", "status": "NO_DATA", "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy." } ] }
- environments
Unique identifier for the environment.
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Creation date of the environment, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Date of most recent environment update, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Current status of the environment.
resizing
is displayed when a request to increase the environment size has been made, but is still in the process of being completed.Possible values: [
active
,pending
,maintenance
,resizing
]If
true
, the environment contains read-only collections that are maintained by IBM.Current size of the environment.
Possible values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]The new size requested for this environment. Only returned when the environment status is
resizing
.Note: Querying and indexing can still be performed during an environment upsize.
Details about the resource usage and capacity of the environment.
- indexCapacity
Summary of the document usage statistics for the environment.
- documents
Number of documents indexed for the environment.
Total number of documents allowed in the environment's capacity.
Summary of the disk usage statistics for the environment.
- diskUsage
Number of bytes within the environment's disk capacity that are currently used to store data.
Total number of bytes available in the environment's disk capacity.
Summary of the collection usage in the environment.
- collections
Number of active collections in the environment.
Total number of collections allowed in the environment.
Information about the Continuous Relevancy Training for this environment.
- searchStatus
Current scope of the training. Always returned as
environment
.The current status of Continuous Relevancy Training for this environment.
Possible values: [
NO_DATA
,INSUFFICENT_DATA
,TRAINING
,TRAINED
,NOT_APPLICABLE
]Long description of the current Continuous Relevancy Training status.
The date stamp of the most recent completed training for this environment.
Response object containing an array of configured environments.
{
"environments": [
{
"environment_id": "ecbda78e-fb06-40b1-a43f-a039fac0adc6",
"name": "byod_environment",
"description": "Private Data Environment",
"created": "2017-07-14T12:54:40.985Z",
"updated": "2017-07-14T12:54:40.985Z",
"read_only": false
},
{
"environment_id": "system",
"name": "Watson System Environment",
"description": "Watson System environment",
"created": "2017-07-13T01:14:20.761Z",
"updated": "2017-07-13T01:14:20.761Z",
"read_only": true
}
]
}
An array of [environments] that are available for the service instance.
Examples:{ "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8", "name": "test_environment", "description": "Test environment", "created": "2016-06-16T10:56:54.957Z", "updated": "2017-05-16T13:56:54.957Z", "status": "active", "read_only": false, "size": "M", "index_capacity": { "documents": { "indexed": 0, "maximum_allowed": 1000000 }, "disk_usage": { "used_bytes": 0, "maximum_allowed_bytes": 85899345920 }, "collections": { "available": 1, "maximum_allowed": 4 } }, "search_status": [ { "scope": "environment", "status": "NO_DATA", "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy." } ] }
- environments
Unique identifier for the environment.
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Creation date of the environment, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Date of most recent environment update, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Current status of the environment.
resizing
is displayed when a request to increase the environment size has been made, but is still in the process of being completed.Possible values: [
active
,pending
,maintenance
,resizing
]If
true
, the environment contains read-only collections that are maintained by IBM.Current size of the environment.
Possible values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]The new size requested for this environment. Only returned when the environment status is
resizing
.Note: Querying and indexing can still be performed during an environment upsize.
Details about the resource usage and capacity of the environment.
- index_capacity
Summary of the document usage statistics for the environment.
- documents
Number of documents indexed for the environment.
Total number of documents allowed in the environment's capacity.
Summary of the disk usage statistics for the environment.
- disk_usage
Number of bytes within the environment's disk capacity that are currently used to store data.
Total number of bytes available in the environment's disk capacity.
Summary of the collection usage in the environment.
- collections
Number of active collections in the environment.
Total number of collections allowed in the environment.
Information about the Continuous Relevancy Training for this environment.
- search_status
Current scope of the training. Always returned as
environment
.The current status of Continuous Relevancy Training for this environment.
Possible values: [
NO_DATA
,INSUFFICENT_DATA
,TRAINING
,TRAINED
,NOT_APPLICABLE
]Long description of the current Continuous Relevancy Training status.
The date stamp of the most recent completed training for this environment.
Response object containing an array of configured environments.
{
"environments": [
{
"environment_id": "ecbda78e-fb06-40b1-a43f-a039fac0adc6",
"name": "byod_environment",
"description": "Private Data Environment",
"created": "2017-07-14T12:54:40.985Z",
"updated": "2017-07-14T12:54:40.985Z",
"read_only": false
},
{
"environment_id": "system",
"name": "Watson System Environment",
"description": "Watson System environment",
"created": "2017-07-13T01:14:20.761Z",
"updated": "2017-07-13T01:14:20.761Z",
"read_only": true
}
]
}
An array of [environments] that are available for the service instance.
Examples:{ "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8", "name": "test_environment", "description": "Test environment", "created": "2016-06-16T10:56:54.957Z", "updated": "2017-05-16T13:56:54.957Z", "status": "active", "read_only": false, "size": "M", "index_capacity": { "documents": { "indexed": 0, "maximum_allowed": 1000000 }, "disk_usage": { "used_bytes": 0, "maximum_allowed_bytes": 85899345920 }, "collections": { "available": 1, "maximum_allowed": 4 } }, "search_status": [ { "scope": "environment", "status": "NO_DATA", "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy." } ] }
- environments
Unique identifier for the environment.
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Creation date of the environment, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Date of most recent environment update, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Current status of the environment.
resizing
is displayed when a request to increase the environment size has been made, but is still in the process of being completed.Possible values: [
active
,pending
,maintenance
,resizing
]If
true
, the environment contains read-only collections that are maintained by IBM.Current size of the environment.
Possible values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]The new size requested for this environment. Only returned when the environment status is
resizing
.Note: Querying and indexing can still be performed during an environment upsize.
Details about the resource usage and capacity of the environment.
- index_capacity
Summary of the document usage statistics for the environment.
- documents
Number of documents indexed for the environment.
Total number of documents allowed in the environment's capacity.
Summary of the disk usage statistics for the environment.
- disk_usage
Number of bytes within the environment's disk capacity that are currently used to store data.
Total number of bytes available in the environment's disk capacity.
Summary of the collection usage in the environment.
- collections
Number of active collections in the environment.
Total number of collections allowed in the environment.
Information about the Continuous Relevancy Training for this environment.
- search_status
Current scope of the training. Always returned as
environment
.The current status of Continuous Relevancy Training for this environment.
Possible values: [
NO_DATA
,INSUFFICENT_DATA
,TRAINING
,TRAINED
,NOT_APPLICABLE
]Long description of the current Continuous Relevancy Training status.
The date stamp of the most recent completed training for this environment.
Response object containing an array of configured environments.
{
"environments": [
{
"environment_id": "ecbda78e-fb06-40b1-a43f-a039fac0adc6",
"name": "byod_environment",
"description": "Private Data Environment",
"created": "2017-07-14T12:54:40.985Z",
"updated": "2017-07-14T12:54:40.985Z",
"read_only": false
},
{
"environment_id": "system",
"name": "Watson System Environment",
"description": "Watson System environment",
"created": "2017-07-13T01:14:20.761Z",
"updated": "2017-07-13T01:14:20.761Z",
"read_only": true
}
]
}
An array of [environments] that are available for the service instance.
Examples:{ "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8", "name": "test_environment", "description": "Test environment", "created": "2016-06-16T10:56:54.957Z", "updated": "2017-05-16T13:56:54.957Z", "status": "active", "read_only": false, "size": "M", "index_capacity": { "documents": { "indexed": 0, "maximum_allowed": 1000000 }, "disk_usage": { "used_bytes": 0, "maximum_allowed_bytes": 85899345920 }, "collections": { "available": 1, "maximum_allowed": 4 } }, "search_status": [ { "scope": "environment", "status": "NO_DATA", "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy." } ] }
- Environments
Unique identifier for the environment.
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Creation date of the environment, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Date of most recent environment update, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Current status of the environment.
resizing
is displayed when a request to increase the environment size has been made, but is still in the process of being completed.Possible values: [
active
,pending
,maintenance
,resizing
]If
true
, the environment contains read-only collections that are maintained by IBM.Current size of the environment.
Possible values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]The new size requested for this environment. Only returned when the environment status is
resizing
.Note: Querying and indexing can still be performed during an environment upsize.
Details about the resource usage and capacity of the environment.
- IndexCapacity
Summary of the document usage statistics for the environment.
- Documents
Number of documents indexed for the environment.
Total number of documents allowed in the environment's capacity.
Summary of the disk usage statistics for the environment.
- DiskUsage
Number of bytes within the environment's disk capacity that are currently used to store data.
Total number of bytes available in the environment's disk capacity.
Summary of the collection usage in the environment.
- Collections
Number of active collections in the environment.
Total number of collections allowed in the environment.
Information about the Continuous Relevancy Training for this environment.
- SearchStatus
Current scope of the training. Always returned as
environment
.The current status of Continuous Relevancy Training for this environment.
Possible values: [
NO_DATA
,INSUFFICENT_DATA
,TRAINING
,TRAINED
,NOT_APPLICABLE
]Long description of the current Continuous Relevancy Training status.
The date stamp of the most recent completed training for this environment.
Status Code
Successful response.
Bad request.
{ "environments": [ { "environment_id": "ecbda78e-fb06-40b1-a43f-a039fac0adc6", "name": "byod_environment", "description": "Private Data Environment", "created": "2017-07-14T12:54:40.985Z", "updated": "2017-07-14T12:54:40.985Z", "read_only": false }, { "environment_id": "system", "name": "Watson System Environment", "description": "Watson System environment", "created": "2017-07-13T01:14:20.761Z", "updated": "2017-07-13T01:14:20.761Z", "read_only": true } ] }
{ "environments": [ { "environment_id": "ecbda78e-fb06-40b1-a43f-a039fac0adc6", "name": "byod_environment", "description": "Private Data Environment", "created": "2017-07-14T12:54:40.985Z", "updated": "2017-07-14T12:54:40.985Z", "read_only": false }, { "environment_id": "system", "name": "Watson System Environment", "description": "Watson System environment", "created": "2017-07-13T01:14:20.761Z", "updated": "2017-07-13T01:14:20.761Z", "read_only": true } ] }
Get environment info
GET /v1/environments/{environment_id}
ServiceCall<Environment> getEnvironment(GetEnvironmentOptions getEnvironmentOptions)
getEnvironment(params)
get_environment(
self,
environment_id: str,
**kwargs,
) -> DetailedResponse
GetEnvironment(string environmentId)
Request
Use the GetEnvironmentOptions.Builder
to create a GetEnvironmentOptions
object that contains the parameter values for the getEnvironment
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The getEnvironment options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.GetEnvironment( environmentId: "{environmentId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; GetEnvironmentOptions getOptions = new GetEnvironmentOptions.Builder(environmentId).build(); Environment getResponse = discovery.getEnvironment(getOptions).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const getEnvironmentParams = { environmentId: '{environment_id}', }; discovery.getEnvironment(getEnvironmentParams) .then(environment => { console.log(JSON.stringify(environment, null, 2)); }) .catch(err => { console.log('error:', err); });
import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') environment_info = discovery.get_environment( '{environment_id}').get_result() print(json.dumps(environment_info, indent=2))
Response
Details about an environment.
Unique identifier for the environment.
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Creation date of the environment, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
Date of most recent environment update, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
Current status of the environment.
resizing
is displayed when a request to increase the environment size has been made, but is still in the process of being completed.Possible values: [
active
,pending
,maintenance
,resizing
]If
true
, the environment contains read-only collections that are maintained by IBM.Current size of the environment.
Possible values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]The new size requested for this environment. Only returned when the environment status is
resizing
.Note: Querying and indexing can still be performed during an environment upsize.
Details about the resource usage and capacity of the environment.
Information about the Continuous Relevancy Training for this environment.
Details about an environment.
{
"environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
"name": "test_environment",
"description": "Test environment",
"created": "2016-06-16T10:56:54.957Z",
"updated": "2017-05-16T13:56:54.957Z",
"status": "active",
"read_only": false,
"size": "M",
"index_capacity": {
"documents": {
"indexed": 0,
"maximum_allowed": 1000000
},
"disk_usage": {
"used_bytes": 0,
"maximum_allowed_bytes": 85899345920
},
"collections": {
"available": 1,
"maximum_allowed": 4
}
},
"search_status": [
{
"scope": "environment",
"status": "NO_DATA",
"status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
}
]
}
Unique identifier for the environment.
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Creation date of the environment, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Date of most recent environment update, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Current status of the environment.
resizing
is displayed when a request to increase the environment size has been made, but is still in the process of being completed.Possible values: [
active
,pending
,maintenance
,resizing
]If
true
, the environment contains read-only collections that are maintained by IBM.Current size of the environment.
Possible values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]The new size requested for this environment. Only returned when the environment status is
resizing
.Note: Querying and indexing can still be performed during an environment upsize.
Details about the resource usage and capacity of the environment.
- indexCapacity
Summary of the document usage statistics for the environment.
- documents
Number of documents indexed for the environment.
Total number of documents allowed in the environment's capacity.
Summary of the disk usage statistics for the environment.
- diskUsage
Number of bytes within the environment's disk capacity that are currently used to store data.
Total number of bytes available in the environment's disk capacity.
Summary of the collection usage in the environment.
- collections
Number of active collections in the environment.
Total number of collections allowed in the environment.
Information about the Continuous Relevancy Training for this environment.
- searchStatus
Current scope of the training. Always returned as
environment
.The current status of Continuous Relevancy Training for this environment.
Possible values: [
NO_DATA
,INSUFFICENT_DATA
,TRAINING
,TRAINED
,NOT_APPLICABLE
]Long description of the current Continuous Relevancy Training status.
The date stamp of the most recent completed training for this environment.
Details about an environment.
{
"environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
"name": "test_environment",
"description": "Test environment",
"created": "2016-06-16T10:56:54.957Z",
"updated": "2017-05-16T13:56:54.957Z",
"status": "active",
"read_only": false,
"size": "M",
"index_capacity": {
"documents": {
"indexed": 0,
"maximum_allowed": 1000000
},
"disk_usage": {
"used_bytes": 0,
"maximum_allowed_bytes": 85899345920
},
"collections": {
"available": 1,
"maximum_allowed": 4
}
},
"search_status": [
{
"scope": "environment",
"status": "NO_DATA",
"status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
}
]
}
Unique identifier for the environment.
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Creation date of the environment, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Date of most recent environment update, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Current status of the environment.
resizing
is displayed when a request to increase the environment size has been made, but is still in the process of being completed.Possible values: [
active
,pending
,maintenance
,resizing
]If
true
, the environment contains read-only collections that are maintained by IBM.Current size of the environment.
Possible values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]The new size requested for this environment. Only returned when the environment status is
resizing
.Note: Querying and indexing can still be performed during an environment upsize.
Details about the resource usage and capacity of the environment.
- index_capacity
Summary of the document usage statistics for the environment.
- documents
Number of documents indexed for the environment.
Total number of documents allowed in the environment's capacity.
Summary of the disk usage statistics for the environment.
- disk_usage
Number of bytes within the environment's disk capacity that are currently used to store data.
Total number of bytes available in the environment's disk capacity.
Summary of the collection usage in the environment.
- collections
Number of active collections in the environment.
Total number of collections allowed in the environment.
Information about the Continuous Relevancy Training for this environment.
- search_status
Current scope of the training. Always returned as
environment
.The current status of Continuous Relevancy Training for this environment.
Possible values: [
NO_DATA
,INSUFFICENT_DATA
,TRAINING
,TRAINED
,NOT_APPLICABLE
]Long description of the current Continuous Relevancy Training status.
The date stamp of the most recent completed training for this environment.
Details about an environment.
{
"environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
"name": "test_environment",
"description": "Test environment",
"created": "2016-06-16T10:56:54.957Z",
"updated": "2017-05-16T13:56:54.957Z",
"status": "active",
"read_only": false,
"size": "M",
"index_capacity": {
"documents": {
"indexed": 0,
"maximum_allowed": 1000000
},
"disk_usage": {
"used_bytes": 0,
"maximum_allowed_bytes": 85899345920
},
"collections": {
"available": 1,
"maximum_allowed": 4
}
},
"search_status": [
{
"scope": "environment",
"status": "NO_DATA",
"status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
}
]
}
Unique identifier for the environment.
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Creation date of the environment, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Date of most recent environment update, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Current status of the environment.
resizing
is displayed when a request to increase the environment size has been made, but is still in the process of being completed.Possible values: [
active
,pending
,maintenance
,resizing
]If
true
, the environment contains read-only collections that are maintained by IBM.Current size of the environment.
Possible values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]The new size requested for this environment. Only returned when the environment status is
resizing
.Note: Querying and indexing can still be performed during an environment upsize.
Details about the resource usage and capacity of the environment.
- index_capacity
Summary of the document usage statistics for the environment.
- documents
Number of documents indexed for the environment.
Total number of documents allowed in the environment's capacity.
Summary of the disk usage statistics for the environment.
- disk_usage
Number of bytes within the environment's disk capacity that are currently used to store data.
Total number of bytes available in the environment's disk capacity.
Summary of the collection usage in the environment.
- collections
Number of active collections in the environment.
Total number of collections allowed in the environment.
Information about the Continuous Relevancy Training for this environment.
- search_status
Current scope of the training. Always returned as
environment
.The current status of Continuous Relevancy Training for this environment.
Possible values: [
NO_DATA
,INSUFFICENT_DATA
,TRAINING
,TRAINED
,NOT_APPLICABLE
]Long description of the current Continuous Relevancy Training status.
The date stamp of the most recent completed training for this environment.
Details about an environment.
{
"environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
"name": "test_environment",
"description": "Test environment",
"created": "2016-06-16T10:56:54.957Z",
"updated": "2017-05-16T13:56:54.957Z",
"status": "active",
"read_only": false,
"size": "M",
"index_capacity": {
"documents": {
"indexed": 0,
"maximum_allowed": 1000000
},
"disk_usage": {
"used_bytes": 0,
"maximum_allowed_bytes": 85899345920
},
"collections": {
"available": 1,
"maximum_allowed": 4
}
},
"search_status": [
{
"scope": "environment",
"status": "NO_DATA",
"status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
}
]
}
Unique identifier for the environment.
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Creation date of the environment, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Date of most recent environment update, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Current status of the environment.
resizing
is displayed when a request to increase the environment size has been made, but is still in the process of being completed.Possible values: [
active
,pending
,maintenance
,resizing
]If
true
, the environment contains read-only collections that are maintained by IBM.Current size of the environment.
Possible values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]The new size requested for this environment. Only returned when the environment status is
resizing
.Note: Querying and indexing can still be performed during an environment upsize.
Details about the resource usage and capacity of the environment.
- IndexCapacity
Summary of the document usage statistics for the environment.
- Documents
Number of documents indexed for the environment.
Total number of documents allowed in the environment's capacity.
Summary of the disk usage statistics for the environment.
- DiskUsage
Number of bytes within the environment's disk capacity that are currently used to store data.
Total number of bytes available in the environment's disk capacity.
Summary of the collection usage in the environment.
- Collections
Number of active collections in the environment.
Total number of collections allowed in the environment.
Information about the Continuous Relevancy Training for this environment.
- SearchStatus
Current scope of the training. Always returned as
environment
.The current status of Continuous Relevancy Training for this environment.
Possible values: [
NO_DATA
,INSUFFICENT_DATA
,TRAINING
,TRAINED
,NOT_APPLICABLE
]Long description of the current Continuous Relevancy Training status.
The date stamp of the most recent completed training for this environment.
Status Code
Environment fetched.
Bad request.
{ "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8", "name": "test_environment", "description": "Test environment", "created": "2016-06-16T10:56:54.957Z", "updated": "2017-05-16T13:56:54.957Z", "status": "active", "read_only": false, "size": "M", "index_capacity": { "documents": { "indexed": 0, "maximum_allowed": 1000000 }, "disk_usage": { "used_bytes": 0, "maximum_allowed_bytes": 85899345920 }, "collections": { "available": 1, "maximum_allowed": 4 } }, "search_status": [ { "scope": "environment", "status": "NO_DATA", "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy." } ] }
{ "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8", "name": "test_environment", "description": "Test environment", "created": "2016-06-16T10:56:54.957Z", "updated": "2017-05-16T13:56:54.957Z", "status": "active", "read_only": false, "size": "M", "index_capacity": { "documents": { "indexed": 0, "maximum_allowed": 1000000 }, "disk_usage": { "used_bytes": 0, "maximum_allowed_bytes": 85899345920 }, "collections": { "available": 1, "maximum_allowed": 4 } }, "search_status": [ { "scope": "environment", "status": "NO_DATA", "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy." } ] }
Update an environment
Updates an environment. The environment's name and description parameters can be changed. You must specify a name for the environment.
Updates an environment. The environment's name and description parameters can be changed. You must specify a name for the environment.
Updates an environment. The environment's name and description parameters can be changed. You must specify a name for the environment.
Updates an environment. The environment's name and description parameters can be changed. You must specify a name for the environment.
Updates an environment. The environment's name and description parameters can be changed. You must specify a name for the environment.
PUT /v1/environments/{environment_id}
ServiceCall<Environment> updateEnvironment(UpdateEnvironmentOptions updateEnvironmentOptions)
updateEnvironment(params)
update_environment(
self,
environment_id: str,
*,
name: str = None,
description: str = None,
size: str = None,
**kwargs,
) -> DetailedResponse
UpdateEnvironment(string environmentId, string name = null, string description = null, string size = null)
Request
Use the UpdateEnvironmentOptions.Builder
to create a UpdateEnvironmentOptions
object that contains the parameter values for the updateEnvironment
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
An object that defines the environment's name and, optionally, description.
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Default:
Description of the environment.
Default:
Size to change the environment to. Note: Lite plan users cannot change the environment size.
Allowable values: [
S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]
The updateEnvironment options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Default:
Description of the environment.
Default:
Size to change the environment to. Note: Lite plan users cannot change the environment size.
Allowable values: [
S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Default:
Description of the environment.
Default:
Size to change the environment to. Note: Lite plan users cannot change the environment size.
Allowable values: [
S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Default:
Description of the environment.
Default:
Size to change the environment to. Note: Lite plan users cannot change the environment size.
Allowable values: [
S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Default:
Description of the environment.
Default:
Size to change the environment to. Note: Lite plan users cannot change the environment size.
Allowable values: [
S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]
curl -X PUT -u "apikey":"{apikey}" -H "Content-Type: application/json" -d '{ "name": "Updated name", "description": "Updated description" }' "{url}/v1/environments/{environment_id}?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.UpdateEnvironment( environmentId: "{environmentId}", name: "Updated name", description: "Updated description" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String environmentName = "Updated name"; String envDescription = "Updated description"; UpdateEnvironmentOptions.Builder updateBuilder = new UpdateEnvironmentOptions.Builder(environmentId, environmentName); updateBuilder.description(envDescription); Environment updateResponse = discovery.updateEnvironment(updateBuilder.build()).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const updateEnvironmentParams = { environmentId: '{environment_id}', name: '{updated name OR current name if updating description (name is required)}', description: '{updated description OR current description if updating just name (description will be set to `null` if not given)}', }; discovery.updateEnvironment(updateEnvironmentParams) .then(environment => { console.log(JSON.stringify(environment, null, 2)); }) .catch(err => { console.log('error:', err); });
import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') new_name = discovery.update_environment( '{environment_id}', name='Updated name', description='Updated description').get_result() print(json.dumps(new_name, indent=2))
Response
Details about an environment.
Unique identifier for the environment.
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Creation date of the environment, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
Date of most recent environment update, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
Current status of the environment.
resizing
is displayed when a request to increase the environment size has been made, but is still in the process of being completed.Possible values: [
active
,pending
,maintenance
,resizing
]If
true
, the environment contains read-only collections that are maintained by IBM.Current size of the environment.
Possible values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]The new size requested for this environment. Only returned when the environment status is
resizing
.Note: Querying and indexing can still be performed during an environment upsize.
Details about the resource usage and capacity of the environment.
Information about the Continuous Relevancy Training for this environment.
Details about an environment.
{
"environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
"name": "test_environment",
"description": "Test environment",
"created": "2016-06-16T10:56:54.957Z",
"updated": "2017-05-16T13:56:54.957Z",
"status": "active",
"read_only": false,
"size": "M",
"index_capacity": {
"documents": {
"indexed": 0,
"maximum_allowed": 1000000
},
"disk_usage": {
"used_bytes": 0,
"maximum_allowed_bytes": 85899345920
},
"collections": {
"available": 1,
"maximum_allowed": 4
}
},
"search_status": [
{
"scope": "environment",
"status": "NO_DATA",
"status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
}
]
}
Unique identifier for the environment.
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Creation date of the environment, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Date of most recent environment update, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Current status of the environment.
resizing
is displayed when a request to increase the environment size has been made, but is still in the process of being completed.Possible values: [
active
,pending
,maintenance
,resizing
]If
true
, the environment contains read-only collections that are maintained by IBM.Current size of the environment.
Possible values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]The new size requested for this environment. Only returned when the environment status is
resizing
.Note: Querying and indexing can still be performed during an environment upsize.
Details about the resource usage and capacity of the environment.
- indexCapacity
Summary of the document usage statistics for the environment.
- documents
Number of documents indexed for the environment.
Total number of documents allowed in the environment's capacity.
Summary of the disk usage statistics for the environment.
- diskUsage
Number of bytes within the environment's disk capacity that are currently used to store data.
Total number of bytes available in the environment's disk capacity.
Summary of the collection usage in the environment.
- collections
Number of active collections in the environment.
Total number of collections allowed in the environment.
Information about the Continuous Relevancy Training for this environment.
- searchStatus
Current scope of the training. Always returned as
environment
.The current status of Continuous Relevancy Training for this environment.
Possible values: [
NO_DATA
,INSUFFICENT_DATA
,TRAINING
,TRAINED
,NOT_APPLICABLE
]Long description of the current Continuous Relevancy Training status.
The date stamp of the most recent completed training for this environment.
Details about an environment.
{
"environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
"name": "test_environment",
"description": "Test environment",
"created": "2016-06-16T10:56:54.957Z",
"updated": "2017-05-16T13:56:54.957Z",
"status": "active",
"read_only": false,
"size": "M",
"index_capacity": {
"documents": {
"indexed": 0,
"maximum_allowed": 1000000
},
"disk_usage": {
"used_bytes": 0,
"maximum_allowed_bytes": 85899345920
},
"collections": {
"available": 1,
"maximum_allowed": 4
}
},
"search_status": [
{
"scope": "environment",
"status": "NO_DATA",
"status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
}
]
}
Unique identifier for the environment.
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Creation date of the environment, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Date of most recent environment update, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Current status of the environment.
resizing
is displayed when a request to increase the environment size has been made, but is still in the process of being completed.Possible values: [
active
,pending
,maintenance
,resizing
]If
true
, the environment contains read-only collections that are maintained by IBM.Current size of the environment.
Possible values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]The new size requested for this environment. Only returned when the environment status is
resizing
.Note: Querying and indexing can still be performed during an environment upsize.
Details about the resource usage and capacity of the environment.
- index_capacity
Summary of the document usage statistics for the environment.
- documents
Number of documents indexed for the environment.
Total number of documents allowed in the environment's capacity.
Summary of the disk usage statistics for the environment.
- disk_usage
Number of bytes within the environment's disk capacity that are currently used to store data.
Total number of bytes available in the environment's disk capacity.
Summary of the collection usage in the environment.
- collections
Number of active collections in the environment.
Total number of collections allowed in the environment.
Information about the Continuous Relevancy Training for this environment.
- search_status
Current scope of the training. Always returned as
environment
.The current status of Continuous Relevancy Training for this environment.
Possible values: [
NO_DATA
,INSUFFICENT_DATA
,TRAINING
,TRAINED
,NOT_APPLICABLE
]Long description of the current Continuous Relevancy Training status.
The date stamp of the most recent completed training for this environment.
Details about an environment.
{
"environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
"name": "test_environment",
"description": "Test environment",
"created": "2016-06-16T10:56:54.957Z",
"updated": "2017-05-16T13:56:54.957Z",
"status": "active",
"read_only": false,
"size": "M",
"index_capacity": {
"documents": {
"indexed": 0,
"maximum_allowed": 1000000
},
"disk_usage": {
"used_bytes": 0,
"maximum_allowed_bytes": 85899345920
},
"collections": {
"available": 1,
"maximum_allowed": 4
}
},
"search_status": [
{
"scope": "environment",
"status": "NO_DATA",
"status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
}
]
}
Unique identifier for the environment.
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Creation date of the environment, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Date of most recent environment update, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Current status of the environment.
resizing
is displayed when a request to increase the environment size has been made, but is still in the process of being completed.Possible values: [
active
,pending
,maintenance
,resizing
]If
true
, the environment contains read-only collections that are maintained by IBM.Current size of the environment.
Possible values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]The new size requested for this environment. Only returned when the environment status is
resizing
.Note: Querying and indexing can still be performed during an environment upsize.
Details about the resource usage and capacity of the environment.
- index_capacity
Summary of the document usage statistics for the environment.
- documents
Number of documents indexed for the environment.
Total number of documents allowed in the environment's capacity.
Summary of the disk usage statistics for the environment.
- disk_usage
Number of bytes within the environment's disk capacity that are currently used to store data.
Total number of bytes available in the environment's disk capacity.
Summary of the collection usage in the environment.
- collections
Number of active collections in the environment.
Total number of collections allowed in the environment.
Information about the Continuous Relevancy Training for this environment.
- search_status
Current scope of the training. Always returned as
environment
.The current status of Continuous Relevancy Training for this environment.
Possible values: [
NO_DATA
,INSUFFICENT_DATA
,TRAINING
,TRAINED
,NOT_APPLICABLE
]Long description of the current Continuous Relevancy Training status.
The date stamp of the most recent completed training for this environment.
Details about an environment.
{
"environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
"name": "test_environment",
"description": "Test environment",
"created": "2016-06-16T10:56:54.957Z",
"updated": "2017-05-16T13:56:54.957Z",
"status": "active",
"read_only": false,
"size": "M",
"index_capacity": {
"documents": {
"indexed": 0,
"maximum_allowed": 1000000
},
"disk_usage": {
"used_bytes": 0,
"maximum_allowed_bytes": 85899345920
},
"collections": {
"available": 1,
"maximum_allowed": 4
}
},
"search_status": [
{
"scope": "environment",
"status": "NO_DATA",
"status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
}
]
}
Unique identifier for the environment.
Name that identifies the environment.
Possible values: 0 ≤ length ≤ 255
Description of the environment.
Creation date of the environment, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Date of most recent environment update, in the format
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.Current status of the environment.
resizing
is displayed when a request to increase the environment size has been made, but is still in the process of being completed.Possible values: [
active
,pending
,maintenance
,resizing
]If
true
, the environment contains read-only collections that are maintained by IBM.Current size of the environment.
Possible values: [
LT
,XS
,S
,MS
,M
,ML
,L
,XL
,XXL
,XXXL
]The new size requested for this environment. Only returned when the environment status is
resizing
.Note: Querying and indexing can still be performed during an environment upsize.
Details about the resource usage and capacity of the environment.
- IndexCapacity
Summary of the document usage statistics for the environment.
- Documents
Number of documents indexed for the environment.
Total number of documents allowed in the environment's capacity.
Summary of the disk usage statistics for the environment.
- DiskUsage
Number of bytes within the environment's disk capacity that are currently used to store data.
Total number of bytes available in the environment's disk capacity.
Summary of the collection usage in the environment.
- Collections
Number of active collections in the environment.
Total number of collections allowed in the environment.
Information about the Continuous Relevancy Training for this environment.
- SearchStatus
Current scope of the training. Always returned as
environment
.The current status of Continuous Relevancy Training for this environment.
Possible values: [
NO_DATA
,INSUFFICENT_DATA
,TRAINING
,TRAINED
,NOT_APPLICABLE
]Long description of the current Continuous Relevancy Training status.
The date stamp of the most recent completed training for this environment.
Status Code
Environment successfully updated.
Bad request.
Forbidden. Returned if you attempt to update a read-only environment.
{ "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8", "name": "test_environment", "description": "Test environment", "created": "2016-06-16T10:56:54.957Z", "updated": "2017-05-16T13:56:54.957Z", "status": "active", "read_only": false, "size": "M", "index_capacity": { "documents": { "indexed": 0, "maximum_allowed": 1000000 }, "disk_usage": { "used_bytes": 0, "maximum_allowed_bytes": 85899345920 }, "collections": { "available": 1, "maximum_allowed": 4 } }, "search_status": [ { "scope": "environment", "status": "NO_DATA", "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy." } ] }
{ "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8", "name": "test_environment", "description": "Test environment", "created": "2016-06-16T10:56:54.957Z", "updated": "2017-05-16T13:56:54.957Z", "status": "active", "read_only": false, "size": "M", "index_capacity": { "documents": { "indexed": 0, "maximum_allowed": 1000000 }, "disk_usage": { "used_bytes": 0, "maximum_allowed_bytes": 85899345920 }, "collections": { "available": 1, "maximum_allowed": 4 } }, "search_status": [ { "scope": "environment", "status": "NO_DATA", "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy." } ] }
Delete environment
DELETE /v1/environments/{environment_id}
ServiceCall<DeleteEnvironmentResponse> deleteEnvironment(DeleteEnvironmentOptions deleteEnvironmentOptions)
deleteEnvironment(params)
delete_environment(
self,
environment_id: str,
**kwargs,
) -> DetailedResponse
DeleteEnvironment(string environmentId)
Request
Use the DeleteEnvironmentOptions.Builder
to create a DeleteEnvironmentOptions
object that contains the parameter values for the deleteEnvironment
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The deleteEnvironment options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -u "apikey":"{apikey}" -X DELETE "{url}/v1/environments/{environment_id}?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.DeleteEnvironment( environmentId: "{environmentId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; DeleteEnvironmentOptions deleteRequest = new DeleteEnvironmentOptions.Builder(environmentId).build(); DeleteEnvironmentResponse deleteResponse = discovery.deleteEnvironment(deleteRequest).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const deleteEnvironmentParams = { environmentId: '{environment_id}', }; discovery.deleteEnvironment(deleteEnvironmentParams) .then(deleteEnvironmentResponse => { console.log(JSON.stringify(deleteEnvironmentResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') del_env = discovery.delete_environment('{environment_id}').get_result() print(json.dumps(del_env, indent=2))
Response
Response object returned when deleting an environment.
The unique identifier for the environment.
Status of the environment.
Possible values: [
deleted
]
Response object returned when deleting an environment.
The unique identifier for the environment.
Status of the environment.
Possible values: [
deleted
]
Response object returned when deleting an environment.
The unique identifier for the environment.
Status of the environment.
Possible values: [
deleted
]
Response object returned when deleting an environment.
The unique identifier for the environment.
Status of the environment.
Possible values: [
deleted
]
Response object returned when deleting an environment.
The unique identifier for the environment.
Status of the environment.
Possible values: [
deleted
]
Status Code
Environment successfully deleted.
Bad request. Example error messages:
Invalid environment id. Please check if the format is correct.
Forbidden. Returned if you attempt to delete a read-only environment.
Returned any time the environment is not found (even immediately after the environment was successfully deleted).
Example error message:
An environment with ID '2cd8bc72-d737-46e3-b26b-05a585111111' was not found.
No Sample Response
List fields across collections
Gets a list of the unique fields (and their types) stored in the indexes of the specified collections.
Gets a list of the unique fields (and their types) stored in the indexes of the specified collections.
Gets a list of the unique fields (and their types) stored in the indexes of the specified collections.
Gets a list of the unique fields (and their types) stored in the indexes of the specified collections.
Gets a list of the unique fields (and their types) stored in the indexes of the specified collections.
GET /v1/environments/{environment_id}/fields
ServiceCall<ListCollectionFieldsResponse> listFields(ListFieldsOptions listFieldsOptions)
listFields(params)
list_fields(
self,
environment_id: str,
collection_ids: List[str],
**kwargs,
) -> DetailedResponse
ListFields(string environmentId, List<string> collectionIds)
Request
Use the ListFieldsOptions.Builder
to create a ListFieldsOptions
object that contains the parameter values for the listFields
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.A comma-separated list of collection IDs to be queried against.
The listFields options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
A comma-separated list of collection IDs to be queried against.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
A comma-separated list of collection IDs to be queried against.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
A comma-separated list of collection IDs to be queried against.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
A comma-separated list of collection IDs to be queried against.
curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/fields?collection_ids={id1},{id2}&version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.ListFields( environmentId: "{environmentId}", collectionIds: new List<string>() { "{collection_id1}", "{collection_id2}" } ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; ListFieldsOptions options = new ListFieldsOptions.Builder() .environmentId(environmentId) .addCollectionIds(collectionId) .build(); ListCollectionFieldsResponse response = discovery.listFields(options).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const listFieldsParams = { environmentId: '{environment_id}', collectionIds: ['{collection id}'], }; discovery.listFields(listFieldsParams) .then(listCollectionFieldsResponse => { console.log(JSON.stringify(listCollectionFieldsResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
import os import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') fields = discovery.list_fields('{environment_id}', ['{collection_id1}','{collection_id2}']).get_result() print(json.dumps(fields, indent=2))
Response
The list of fetched fields.
The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.
-
Fields which contain nested JSON objects are assigned a type of "nested".
-
Fields which belong to a nested object are prefixed with
.properties
(for example,warnings.properties.severity
means that thewarnings
object has a property calledseverity
). -
Fields returned from the News collection are prefixed with
v{N}-fullnews-t3-{YEAR}.mappings
(for example,v5-fullnews-t3-2016.mappings.text.properties.author
).
An array containing information about each field in the collections.
The list of fetched fields.
The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.
-
Fields which contain nested JSON objects are assigned a type of "nested".
-
Fields which belong to a nested object are prefixed with
.properties
(for example,warnings.properties.severity
means that thewarnings
object has a property calledseverity
). -
Fields returned from the News collection are prefixed with
v{N}-fullnews-t3-{YEAR}.mappings
(for example,v5-fullnews-t3-2016.mappings.text.properties.author
).
{
"fields": [
{
"field": "warnings",
"type": "nested"
},
{
"field": "warnings.properties.description",
"type": "string"
},
{
"field": "warnings.properties.phase",
"type": "string"
},
{
"field": "warnings.properties.warning_id",
"type": "string"
}
]
}
An array containing information about each field in the collections.
- fields
The name of the field.
The type of the field.
Possible values: [
nested
,string
,date
,long
,integer
,short
,byte
,double
,float
,boolean
,binary
]
The list of fetched fields.
The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.
-
Fields which contain nested JSON objects are assigned a type of "nested".
-
Fields which belong to a nested object are prefixed with
.properties
(for example,warnings.properties.severity
means that thewarnings
object has a property calledseverity
). -
Fields returned from the News collection are prefixed with
v{N}-fullnews-t3-{YEAR}.mappings
(for example,v5-fullnews-t3-2016.mappings.text.properties.author
).
{
"fields": [
{
"field": "warnings",
"type": "nested"
},
{
"field": "warnings.properties.description",
"type": "string"
},
{
"field": "warnings.properties.phase",
"type": "string"
},
{
"field": "warnings.properties.warning_id",
"type": "string"
}
]
}
An array containing information about each field in the collections.
- fields
The name of the field.
The type of the field.
Possible values: [
nested
,string
,date
,long
,integer
,short
,byte
,double
,float
,boolean
,binary
]
The list of fetched fields.
The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.
-
Fields which contain nested JSON objects are assigned a type of "nested".
-
Fields which belong to a nested object are prefixed with
.properties
(for example,warnings.properties.severity
means that thewarnings
object has a property calledseverity
). -
Fields returned from the News collection are prefixed with
v{N}-fullnews-t3-{YEAR}.mappings
(for example,v5-fullnews-t3-2016.mappings.text.properties.author
).
{
"fields": [
{
"field": "warnings",
"type": "nested"
},
{
"field": "warnings.properties.description",
"type": "string"
},
{
"field": "warnings.properties.phase",
"type": "string"
},
{
"field": "warnings.properties.warning_id",
"type": "string"
}
]
}
An array containing information about each field in the collections.
- fields
The name of the field.
The type of the field.
Possible values: [
nested
,string
,date
,long
,integer
,short
,byte
,double
,float
,boolean
,binary
]
The list of fetched fields.
The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.
-
Fields which contain nested JSON objects are assigned a type of "nested".
-
Fields which belong to a nested object are prefixed with
.properties
(for example,warnings.properties.severity
means that thewarnings
object has a property calledseverity
). -
Fields returned from the News collection are prefixed with
v{N}-fullnews-t3-{YEAR}.mappings
(for example,v5-fullnews-t3-2016.mappings.text.properties.author
).
{
"fields": [
{
"field": "warnings",
"type": "nested"
},
{
"field": "warnings.properties.description",
"type": "string"
},
{
"field": "warnings.properties.phase",
"type": "string"
},
{
"field": "warnings.properties.warning_id",
"type": "string"
}
]
}
An array containing information about each field in the collections.
- Fields
The name of the field.
The type of the field.
Possible values: [
nested
,string
,date
,long
,integer
,short
,byte
,double
,float
,boolean
,binary
]
Status Code
The list of fetched fields.
The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations:
-
Fields which contain nested JSON objects are assigned a type of "nested".
-
Fields which belong to a nested object are prefixed with
.properties
(for example,warnings.properties.severity
means that thewarnings
object has a property calledseverity
). -
Fields returned from the News collection are prefixed with
v{N}-fullnews-t3-{YEAR}.mappings
(for example,v5-fullnews-t3-2016.mappings.text.properties.author
).
-
Bad request.
{ "fields": [ { "field": "warnings", "type": "nested" }, { "field": "warnings.properties.description", "type": "string" }, { "field": "warnings.properties.phase", "type": "string" }, { "field": "warnings.properties.warning_id", "type": "string" } ] }
{ "fields": [ { "field": "warnings", "type": "nested" }, { "field": "warnings.properties.description", "type": "string" }, { "field": "warnings.properties.phase", "type": "string" }, { "field": "warnings.properties.warning_id", "type": "string" } ] }
Add configuration
Creates a new configuration.
If the input configuration contains the configuration_id, created, or updated properties, then they are ignored and overridden by the system, and an error is not returned so that the overridden fields do not need to be removed when copying a configuration.
The configuration can contain unrecognized JSON fields. Any such fields are ignored and do not generate an error. This makes it easier to use newer configuration files with older versions of the API and the service. It also makes it possible for the tooling to add additional metadata and information to the configuration.
Creates a new configuration.
If the input configuration contains the configuration_id, created, or updated properties, then they are ignored and overridden by the system, and an error is not returned so that the overridden fields do not need to be removed when copying a configuration.
The configuration can contain unrecognized JSON fields. Any such fields are ignored and do not generate an error. This makes it easier to use newer configuration files with older versions of the API and the service. It also makes it possible for the tooling to add additional metadata and information to the configuration.
Creates a new configuration.
If the input configuration contains the configuration_id, created, or updated properties, then they are ignored and overridden by the system, and an error is not returned so that the overridden fields do not need to be removed when copying a configuration.
The configuration can contain unrecognized JSON fields. Any such fields are ignored and do not generate an error. This makes it easier to use newer configuration files with older versions of the API and the service. It also makes it possible for the tooling to add additional metadata and information to the configuration.
Creates a new configuration.
If the input configuration contains the configuration_id, created, or updated properties, then they are ignored and overridden by the system, and an error is not returned so that the overridden fields do not need to be removed when copying a configuration.
The configuration can contain unrecognized JSON fields. Any such fields are ignored and do not generate an error. This makes it easier to use newer configuration files with older versions of the API and the service. It also makes it possible for the tooling to add additional metadata and information to the configuration.
Creates a new configuration.
If the input configuration contains the configuration_id, created, or updated properties, then they are ignored and overridden by the system, and an error is not returned so that the overridden fields do not need to be removed when copying a configuration.
The configuration can contain unrecognized JSON fields. Any such fields are ignored and do not generate an error. This makes it easier to use newer configuration files with older versions of the API and the service. It also makes it possible for the tooling to add additional metadata and information to the configuration.
POST /v1/environments/{environment_id}/configurations
ServiceCall<Configuration> createConfiguration(CreateConfigurationOptions createConfigurationOptions)
createConfiguration(params)
create_configuration(
self,
environment_id: str,
name: str,
*,
description: str = None,
conversions: 'Conversions' = None,
enrichments: List['Enrichment'] = None,
normalizations: List['NormalizationOperation'] = None,
source: 'Source' = None,
**kwargs,
) -> DetailedResponse
CreateConfiguration(string environmentId, string name, string description = null, Conversions conversions = null, List<Enrichment> enrichments = null, List<NormalizationOperation> normalizations = null, Source source = null)
Request
Use the CreateConfigurationOptions.Builder
to create a CreateConfigurationOptions
object that contains the parameter values for the createConfiguration
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
Input an object that enables you to customize how your content is ingested and what enrichments are added to your data.
name is required and must be unique within the current environment. All other properties are optional.
If the input configuration contains the configuration_id, created, or updated properties, then they will be ignored and overridden by the system (an error is not returned so that the overridden fields do not need to be removed when copying a configuration).
The configuration can contain unrecognized JSON fields. Any such fields will be ignored and will not generate an error. This makes it easier to use newer configuration files with older versions of the API and the service. It also makes it possible for the tooling to add additional metadata and information to the configuration.
{
"configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
"name": "IBM News",
"created": "2015-08-24T18:42:25.324Z",
"updated": "2015-08-24T18:42:25.324Z",
"description": "A configuration useful for ingesting IBM press releases.",
"conversions": {
"html": {
"exclude_tags_keep_content": [
"span"
],
"exclude_content": {
"xpaths": [
"/home"
]
}
},
"segment": {
"enabled": true,
"annotated_fields": [
"custom-field-1",
"custom-field-2"
]
},
"json_normalizations": [
{
"operation": "move",
"source_field": "extracted_metadata.title",
"destination_field": "metadata.title"
},
{
"operation": "move",
"source_field": "extracted_metadata.author",
"destination_field": "metadata.author"
},
{
"operation": "remove",
"source_field": "extracted_metadata"
}
]
},
"enrichments": [
{
"enrichment": "natural_language_understanding",
"source_field": "title",
"destination_field": "enriched_title",
"options": {
"features": {
"keywords": {
"sentiment": true,
"emotion": false,
"limit": 50
},
"entities": {
"sentiment": true,
"emotion": false,
"limit": 50,
"mentions": true,
"mention_types": true,
"sentence_locations": true,
"model": "WKS-model-id"
},
"sentiment": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"emotion": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"categories": {},
"concepts": {
"limit": 8
},
"semantic_roles": {
"entities": true,
"keywords": true,
"limit": 50
},
"relations": {
"model": "WKS-model-id"
}
}
}
}
],
"normalizations": [
{
"operation": "move",
"source_field": "metadata.title",
"destination_field": "title"
},
{
"operation": "move",
"source_field": "metadata.author",
"destination_field": "author"
},
{
"operation": "remove",
"source_field": "html"
},
{
"operation": "remove_nulls"
}
],
"source": {
"type": "salesforce",
"credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
"schedule": {
"enabled": true,
"time_zone": "America/New_York",
"frequency": "weekly"
},
"options": {
"site_collections": [
{
"site_collection_path": "/sites/TestSiteA",
"limit": 10
}
]
}
}
}
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The description of the configuration, if available.
Document conversion settings.
An array of document enrichment settings for the configuration.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
Object containing source parameters for the configuration.
The createConfiguration options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The description of the configuration, if available.
Document conversion settings.
- conversions
A list of PDF conversion settings.
- pdf
Object containing heading detection conversion settings for PDF documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- word
Object containing heading detection conversion settings for Microsoft Word documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- keepContent
An array to XPaths.
Object containing an array of XPaths.
- excludeContent
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- segment
Enables/disables the Document Segmentation feature.
Default:
false
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Default:
["h1","h2"]
Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- jsonNormalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Allowable values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.Default:
true
An array of document enrichment settings for the configuration.
- enrichments
Describes what the enrichment step does.
Default:
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Default:
false
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Default:
false
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- options
Object containing Natural Language Understanding features to be used.
- features
An object specifying the Keyword enrichment and related parameters.
- keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- semanticRoles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Allowable values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Allowable values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Allowable values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.Default:
true
The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
Default:
America/New_York
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Allowable values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- siteCollections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.Default:
true
The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Allowable values: [
gentle
,normal
,aggressive
]Default:
normal
When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.Default:
false
The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
Default:
2
The maximum milliseconds to wait for a response from the web server.
Default:
30000
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Default:
false
Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The description of the configuration, if available.
Document conversion settings.
- conversions
A list of PDF conversion settings.
- pdf
Object containing heading detection conversion settings for PDF documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- word
Object containing heading detection conversion settings for Microsoft Word documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- keep_content
An array to XPaths.
Object containing an array of XPaths.
- exclude_content
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- segment
Enables/disables the Document Segmentation feature.
Default:
false
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Default:
["h1","h2"]
Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- json_normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Allowable values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.Default:
true
An array of document enrichment settings for the configuration.
- enrichments
Describes what the enrichment step does.
Default:
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Default:
false
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Default:
false
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- options
Object containing Natural Language Understanding features to be used.
- features
An object specifying the Keyword enrichment and related parameters.
- keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- semantic_roles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Allowable values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Allowable values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Allowable values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.Default:
true
The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
Default:
America/New_York
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Allowable values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- site_collections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.Default:
true
The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Allowable values: [
gentle
,normal
,aggressive
]Default:
normal
When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.Default:
false
The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
Default:
2
The maximum milliseconds to wait for a response from the web server.
Default:
30000
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Default:
false
Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The description of the configuration, if available.
Document conversion settings.
- conversions
A list of PDF conversion settings.
- pdf
Object containing heading detection conversion settings for PDF documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- word
Object containing heading detection conversion settings for Microsoft Word documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- keep_content
An array to XPaths.
Object containing an array of XPaths.
- exclude_content
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- segment
Enables/disables the Document Segmentation feature.
Default:
false
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Default:
["h1","h2"]
Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- json_normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Allowable values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.Default:
true
An array of document enrichment settings for the configuration.
- enrichments
Describes what the enrichment step does.
Default:
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Default:
false
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Default:
false
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- options
Object containing Natural Language Understanding features to be used.
- features
An object specifying the Keyword enrichment and related parameters.
- keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- semantic_roles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Allowable values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Allowable values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Allowable values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.Default:
true
The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
Default:
America/New_York
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Allowable values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- site_collections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.Default:
true
The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Allowable values: [
gentle
,normal
,aggressive
]Default:
normal
When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.Default:
false
The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
Default:
2
The maximum milliseconds to wait for a response from the web server.
Default:
30000
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Default:
false
Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The description of the configuration, if available.
Document conversion settings.
- conversions
A list of PDF conversion settings.
- Pdf
Object containing heading detection conversion settings for PDF documents.
- Heading
Array of font matching configurations.
- Fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- Word
Object containing heading detection conversion settings for Microsoft Word documents.
- Heading
Array of font matching configurations.
- Fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- Styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- Html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- KeepContent
An array to XPaths.
Object containing an array of XPaths.
- ExcludeContent
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- Segment
Enables/disables the Document Segmentation feature.
Default:
false
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Default:
["h1","h2"]
Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- JsonNormalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Allowable values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.Default:
true
An array of document enrichment settings for the configuration.
- enrichments
Describes what the enrichment step does.
Default:
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Default:
false
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Default:
false
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- Options
Object containing Natural Language Understanding features to be used.
- Features
An object specifying the Keyword enrichment and related parameters.
- Keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- Entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- Sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- Emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- SemanticRoles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- Relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- Concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Allowable values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Allowable values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Allowable values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- Schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.Default:
true
The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
Default:
America/New_York
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Allowable values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- Options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- Folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- Objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- SiteCollections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- Urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.Default:
true
The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Allowable values: [
gentle
,normal
,aggressive
]Default:
normal
When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.Default:
false
The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
Default:
2
The maximum milliseconds to wait for a response from the web server.
Default:
30000
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Default:
false
Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- Buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
curl -X POST -u "apikey":"{apikey}" -H "Content-Type: application/json" -d @config.json "{url}/v1/environments/{environment_id}/configurations?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.CreateConfiguration( environmentId: "{environmentId}", name: "doc-config" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id"}; String configurationName = "doc-config"; CreateConfigurationOptions.Builder createBuilder = new CreateConfigurationOptions.Builder(); Configuration configuration = GsonSingleton.getGson().fromJson( new FileReader("./config.json"), com.ibm.watson.internal.discovery.model.configuration.Configuration.class); configuration.setName(configurationName); createBuilder.configuration(configuration); createBuilder.environmentId(environmentId); Configuration createResponse = discovery.createConfiguration(createBuilder.build()).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const createConfigurationParams = { environmentId: '{environment_id}', name: 'node-examples-test', }; discovery.createConfiguration(createConfigurationParams) .then(configuration => { console.log(JSON.stringify(configuration, null, 2)); }) .catch(err => { console.log('error:', err); });
import os import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') with open(os.path.join(os.getcwd(), 'config.json')) as config_data: data = json.load(config_data) new_config = discovery.create_configuration( '{environment_id}', data['name'], description=data['description'], conversions=data['conversions'], enrichments=data['enrichments'], normalizations=data['normalizations']).get_result() print(json.dumps(new_config, indent=2))
Response
A custom configuration for the environment.
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The unique identifier of the configuration
The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
The description of the configuration, if available.
Document conversion settings.
An array of document enrichment settings for the configuration.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
Object containing source parameters for the configuration.
A custom configuration for the environment.
{
"configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
"name": "IBM News",
"created": "2015-08-24T18:42:25.324Z",
"updated": "2015-08-24T18:42:25.324Z",
"description": "A configuration useful for ingesting IBM press releases.",
"conversions": {
"html": {
"exclude_tags_keep_content": [
"span"
],
"exclude_content": {
"xpaths": [
"/home"
]
}
},
"segment": {
"enabled": true,
"annotated_fields": [
"custom-field-1",
"custom-field-2"
]
},
"json_normalizations": [
{
"operation": "move",
"source_field": "extracted_metadata.title",
"destination_field": "metadata.title"
},
{
"operation": "move",
"source_field": "extracted_metadata.author",
"destination_field": "metadata.author"
},
{
"operation": "remove",
"source_field": "extracted_metadata"
}
]
},
"enrichments": [
{
"enrichment": "natural_language_understanding",
"source_field": "title",
"destination_field": "enriched_title",
"options": {
"features": {
"keywords": {
"sentiment": true,
"emotion": false,
"limit": 50
},
"entities": {
"sentiment": true,
"emotion": false,
"limit": 50,
"mentions": true,
"mention_types": true,
"sentence_locations": true,
"model": "WKS-model-id"
},
"sentiment": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"emotion": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"categories": {},
"concepts": {
"limit": 8
},
"semantic_roles": {
"entities": true,
"keywords": true,
"limit": 50
},
"relations": {
"model": "WKS-model-id"
}
}
}
}
],
"normalizations": [
{
"operation": "move",
"source_field": "metadata.title",
"destination_field": "title"
},
{
"operation": "move",
"source_field": "metadata.author",
"destination_field": "author"
},
{
"operation": "remove",
"source_field": "html"
},
{
"operation": "remove_nulls"
}
],
"source": {
"type": "salesforce",
"credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
"schedule": {
"enabled": true,
"time_zone": "America/New_York",
"frequency": "weekly"
},
"options": {
"site_collections": [
{
"site_collection_path": "/sites/TestSiteA",
"limit": 10
}
]
}
}
}
The unique identifier of the configuration.
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The description of the configuration, if available.
Document conversion settings.
- conversions
A list of PDF conversion settings.
- pdf
Object containing heading detection conversion settings for PDF documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- word
Object containing heading detection conversion settings for Microsoft Word documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- keepContent
An array to XPaths.
Object containing an array of XPaths.
- excludeContent
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- segment
Enables/disables the Document Segmentation feature.
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- jsonNormalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.
An array of document enrichment settings for the configuration.
- enrichments
Describes what the enrichment step does.
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- options
Object containing Natural Language Understanding features to be used.
- features
An object specifying the Keyword enrichment and related parameters.
- keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- semanticRoles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Possible values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Possible values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- siteCollections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Possible values: [
gentle
,normal
,aggressive
]When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
The maximum milliseconds to wait for a response from the web server.
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
A custom configuration for the environment.
{
"configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
"name": "IBM News",
"created": "2015-08-24T18:42:25.324Z",
"updated": "2015-08-24T18:42:25.324Z",
"description": "A configuration useful for ingesting IBM press releases.",
"conversions": {
"html": {
"exclude_tags_keep_content": [
"span"
],
"exclude_content": {
"xpaths": [
"/home"
]
}
},
"segment": {
"enabled": true,
"annotated_fields": [
"custom-field-1",
"custom-field-2"
]
},
"json_normalizations": [
{
"operation": "move",
"source_field": "extracted_metadata.title",
"destination_field": "metadata.title"
},
{
"operation": "move",
"source_field": "extracted_metadata.author",
"destination_field": "metadata.author"
},
{
"operation": "remove",
"source_field": "extracted_metadata"
}
]
},
"enrichments": [
{
"enrichment": "natural_language_understanding",
"source_field": "title",
"destination_field": "enriched_title",
"options": {
"features": {
"keywords": {
"sentiment": true,
"emotion": false,
"limit": 50
},
"entities": {
"sentiment": true,
"emotion": false,
"limit": 50,
"mentions": true,
"mention_types": true,
"sentence_locations": true,
"model": "WKS-model-id"
},
"sentiment": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"emotion": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"categories": {},
"concepts": {
"limit": 8
},
"semantic_roles": {
"entities": true,
"keywords": true,
"limit": 50
},
"relations": {
"model": "WKS-model-id"
}
}
}
}
],
"normalizations": [
{
"operation": "move",
"source_field": "metadata.title",
"destination_field": "title"
},
{
"operation": "move",
"source_field": "metadata.author",
"destination_field": "author"
},
{
"operation": "remove",
"source_field": "html"
},
{
"operation": "remove_nulls"
}
],
"source": {
"type": "salesforce",
"credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
"schedule": {
"enabled": true,
"time_zone": "America/New_York",
"frequency": "weekly"
},
"options": {
"site_collections": [
{
"site_collection_path": "/sites/TestSiteA",
"limit": 10
}
]
}
}
}
The unique identifier of the configuration.
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The description of the configuration, if available.
Document conversion settings.
- conversions
A list of PDF conversion settings.
- pdf
Object containing heading detection conversion settings for PDF documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- word
Object containing heading detection conversion settings for Microsoft Word documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- keep_content
An array to XPaths.
Object containing an array of XPaths.
- exclude_content
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- segment
Enables/disables the Document Segmentation feature.
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- json_normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.
An array of document enrichment settings for the configuration.
- enrichments
Describes what the enrichment step does.
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- options
Object containing Natural Language Understanding features to be used.
- features
An object specifying the Keyword enrichment and related parameters.
- keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- semantic_roles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Possible values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Possible values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- site_collections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Possible values: [
gentle
,normal
,aggressive
]When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
The maximum milliseconds to wait for a response from the web server.
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
A custom configuration for the environment.
{
"configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
"name": "IBM News",
"created": "2015-08-24T18:42:25.324Z",
"updated": "2015-08-24T18:42:25.324Z",
"description": "A configuration useful for ingesting IBM press releases.",
"conversions": {
"html": {
"exclude_tags_keep_content": [
"span"
],
"exclude_content": {
"xpaths": [
"/home"
]
}
},
"segment": {
"enabled": true,
"annotated_fields": [
"custom-field-1",
"custom-field-2"
]
},
"json_normalizations": [
{
"operation": "move",
"source_field": "extracted_metadata.title",
"destination_field": "metadata.title"
},
{
"operation": "move",
"source_field": "extracted_metadata.author",
"destination_field": "metadata.author"
},
{
"operation": "remove",
"source_field": "extracted_metadata"
}
]
},
"enrichments": [
{
"enrichment": "natural_language_understanding",
"source_field": "title",
"destination_field": "enriched_title",
"options": {
"features": {
"keywords": {
"sentiment": true,
"emotion": false,
"limit": 50
},
"entities": {
"sentiment": true,
"emotion": false,
"limit": 50,
"mentions": true,
"mention_types": true,
"sentence_locations": true,
"model": "WKS-model-id"
},
"sentiment": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"emotion": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"categories": {},
"concepts": {
"limit": 8
},
"semantic_roles": {
"entities": true,
"keywords": true,
"limit": 50
},
"relations": {
"model": "WKS-model-id"
}
}
}
}
],
"normalizations": [
{
"operation": "move",
"source_field": "metadata.title",
"destination_field": "title"
},
{
"operation": "move",
"source_field": "metadata.author",
"destination_field": "author"
},
{
"operation": "remove",
"source_field": "html"
},
{
"operation": "remove_nulls"
}
],
"source": {
"type": "salesforce",
"credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
"schedule": {
"enabled": true,
"time_zone": "America/New_York",
"frequency": "weekly"
},
"options": {
"site_collections": [
{
"site_collection_path": "/sites/TestSiteA",
"limit": 10
}
]
}
}
}
The unique identifier of the configuration.
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The description of the configuration, if available.
Document conversion settings.
- conversions
A list of PDF conversion settings.
- pdf
Object containing heading detection conversion settings for PDF documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- word
Object containing heading detection conversion settings for Microsoft Word documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- keep_content
An array to XPaths.
Object containing an array of XPaths.
- exclude_content
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- segment
Enables/disables the Document Segmentation feature.
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- json_normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.
An array of document enrichment settings for the configuration.
- enrichments
Describes what the enrichment step does.
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- options
Object containing Natural Language Understanding features to be used.
- features
An object specifying the Keyword enrichment and related parameters.
- keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- semantic_roles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Possible values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Possible values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- site_collections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Possible values: [
gentle
,normal
,aggressive
]When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
The maximum milliseconds to wait for a response from the web server.
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
A custom configuration for the environment.
{
"configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
"name": "IBM News",
"created": "2015-08-24T18:42:25.324Z",
"updated": "2015-08-24T18:42:25.324Z",
"description": "A configuration useful for ingesting IBM press releases.",
"conversions": {
"html": {
"exclude_tags_keep_content": [
"span"
],
"exclude_content": {
"xpaths": [
"/home"
]
}
},
"segment": {
"enabled": true,
"annotated_fields": [
"custom-field-1",
"custom-field-2"
]
},
"json_normalizations": [
{
"operation": "move",
"source_field": "extracted_metadata.title",
"destination_field": "metadata.title"
},
{
"operation": "move",
"source_field": "extracted_metadata.author",
"destination_field": "metadata.author"
},
{
"operation": "remove",
"source_field": "extracted_metadata"
}
]
},
"enrichments": [
{
"enrichment": "natural_language_understanding",
"source_field": "title",
"destination_field": "enriched_title",
"options": {
"features": {
"keywords": {
"sentiment": true,
"emotion": false,
"limit": 50
},
"entities": {
"sentiment": true,
"emotion": false,
"limit": 50,
"mentions": true,
"mention_types": true,
"sentence_locations": true,
"model": "WKS-model-id"
},
"sentiment": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"emotion": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"categories": {},
"concepts": {
"limit": 8
},
"semantic_roles": {
"entities": true,
"keywords": true,
"limit": 50
},
"relations": {
"model": "WKS-model-id"
}
}
}
}
],
"normalizations": [
{
"operation": "move",
"source_field": "metadata.title",
"destination_field": "title"
},
{
"operation": "move",
"source_field": "metadata.author",
"destination_field": "author"
},
{
"operation": "remove",
"source_field": "html"
},
{
"operation": "remove_nulls"
}
],
"source": {
"type": "salesforce",
"credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
"schedule": {
"enabled": true,
"time_zone": "America/New_York",
"frequency": "weekly"
},
"options": {
"site_collections": [
{
"site_collection_path": "/sites/TestSiteA",
"limit": 10
}
]
}
}
}
The unique identifier of the configuration.
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The description of the configuration, if available.
Document conversion settings.
- Conversions
A list of PDF conversion settings.
- Pdf
Object containing heading detection conversion settings for PDF documents.
- Heading
Array of font matching configurations.
- Fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- Word
Object containing heading detection conversion settings for Microsoft Word documents.
- Heading
Array of font matching configurations.
- Fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- Styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- Html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- KeepContent
An array to XPaths.
Object containing an array of XPaths.
- ExcludeContent
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- Segment
Enables/disables the Document Segmentation feature.
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- JsonNormalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.
An array of document enrichment settings for the configuration.
- Enrichments
Describes what the enrichment step does.
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- Options
Object containing Natural Language Understanding features to be used.
- Features
An object specifying the Keyword enrichment and related parameters.
- Keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- Entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- Sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- Emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- SemanticRoles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- Relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- Concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Possible values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- Normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- Source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- Schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Possible values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- Options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- Folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- Objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- SiteCollections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- Urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Possible values: [
gentle
,normal
,aggressive
]When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
The maximum milliseconds to wait for a response from the web server.
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- Buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
Status Code
Configuration successfully created.
Bad request.
Forbidden. Returned if you attempt to add a configuration to a read-only environment.
{ "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e", "name": "IBM News", "created": "2015-08-24T18:42:25.324Z", "updated": "2015-08-24T18:42:25.324Z", "description": "A configuration useful for ingesting IBM press releases.", "conversions": { "html": { "exclude_tags_keep_content": [ "span" ], "exclude_content": { "xpaths": [ "/home" ] } }, "segment": { "enabled": true, "annotated_fields": [ "custom-field-1", "custom-field-2" ] }, "json_normalizations": [ { "operation": "move", "source_field": "extracted_metadata.title", "destination_field": "metadata.title" }, { "operation": "move", "source_field": "extracted_metadata.author", "destination_field": "metadata.author" }, { "operation": "remove", "source_field": "extracted_metadata" } ] }, "enrichments": [ { "enrichment": "natural_language_understanding", "source_field": "title", "destination_field": "enriched_title", "options": { "features": { "keywords": { "sentiment": true, "emotion": false, "limit": 50 }, "entities": { "sentiment": true, "emotion": false, "limit": 50, "mentions": true, "mention_types": true, "sentence_locations": true, "model": "WKS-model-id" }, "sentiment": { "document": true, "targets": [ "IBM", "Watson" ] }, "emotion": { "document": true, "targets": [ "IBM", "Watson" ] }, "categories": {}, "concepts": { "limit": 8 }, "semantic_roles": { "entities": true, "keywords": true, "limit": 50 }, "relations": { "model": "WKS-model-id" } } } } ], "normalizations": [ { "operation": "move", "source_field": "metadata.title", "destination_field": "title" }, { "operation": "move", "source_field": "metadata.author", "destination_field": "author" }, { "operation": "remove", "source_field": "html" }, { "operation": "remove_nulls" } ], "source": { "type": "salesforce", "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b", "schedule": { "enabled": true, "time_zone": "America/New_York", "frequency": "weekly" }, "options": { "site_collections": [ { "site_collection_path": "/sites/TestSiteA", "limit": 10 } ] } } }
{ "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e", "name": "IBM News", "created": "2015-08-24T18:42:25.324Z", "updated": "2015-08-24T18:42:25.324Z", "description": "A configuration useful for ingesting IBM press releases.", "conversions": { "html": { "exclude_tags_keep_content": [ "span" ], "exclude_content": { "xpaths": [ "/home" ] } }, "segment": { "enabled": true, "annotated_fields": [ "custom-field-1", "custom-field-2" ] }, "json_normalizations": [ { "operation": "move", "source_field": "extracted_metadata.title", "destination_field": "metadata.title" }, { "operation": "move", "source_field": "extracted_metadata.author", "destination_field": "metadata.author" }, { "operation": "remove", "source_field": "extracted_metadata" } ] }, "enrichments": [ { "enrichment": "natural_language_understanding", "source_field": "title", "destination_field": "enriched_title", "options": { "features": { "keywords": { "sentiment": true, "emotion": false, "limit": 50 }, "entities": { "sentiment": true, "emotion": false, "limit": 50, "mentions": true, "mention_types": true, "sentence_locations": true, "model": "WKS-model-id" }, "sentiment": { "document": true, "targets": [ "IBM", "Watson" ] }, "emotion": { "document": true, "targets": [ "IBM", "Watson" ] }, "categories": {}, "concepts": { "limit": 8 }, "semantic_roles": { "entities": true, "keywords": true, "limit": 50 }, "relations": { "model": "WKS-model-id" } } } } ], "normalizations": [ { "operation": "move", "source_field": "metadata.title", "destination_field": "title" }, { "operation": "move", "source_field": "metadata.author", "destination_field": "author" }, { "operation": "remove", "source_field": "html" }, { "operation": "remove_nulls" } ], "source": { "type": "salesforce", "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b", "schedule": { "enabled": true, "time_zone": "America/New_York", "frequency": "weekly" }, "options": { "site_collections": [ { "site_collection_path": "/sites/TestSiteA", "limit": 10 } ] } } }
List configurations
Lists existing configurations for the service instance.
Lists existing configurations for the service instance.
Lists existing configurations for the service instance.
Lists existing configurations for the service instance.
Lists existing configurations for the service instance.
GET /v1/environments/{environment_id}/configurations
ServiceCall<ListConfigurationsResponse> listConfigurations(ListConfigurationsOptions listConfigurationsOptions)
listConfigurations(params)
list_configurations(
self,
environment_id: str,
*,
name: str = None,
**kwargs,
) -> DetailedResponse
ListConfigurations(string environmentId, string name = null)
Request
Use the ListConfigurationsOptions.Builder
to create a ListConfigurationsOptions
object that contains the parameter values for the listConfigurations
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.Find configurations with the given name.
The listConfigurations options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
Find configurations with the given name.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
Find configurations with the given name.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
Find configurations with the given name.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
Find configurations with the given name.
curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/configurations?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.ListConfigurations( environmentId: "{environmentId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; ListConfigurationsOptions listOptions = new ListConfigurationsOptions.Builder(environmentId).build(); ListConfigurationsResponse listResponse = discovery.listConfigurations(listOptions).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const listConfigurationsParams = { environmentId: '{environment_id}', }; discovery.listConfigurations(listConfigurationsParams) .then(listConfigurationsResponse => { console.log(JSON.stringify(listConfigurationsResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') configs = discovery.list_configurations('{environment_id}').get_result() print(json.dumps(configs, indent=2))
Response
Object containing an array of available configurations.
An array of configurations that are available for the service instance.
Object containing an array of available configurations.
An array of configurations that are available for the service instance.
Examples:{ "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e", "name": "IBM News", "created": "2015-08-24T18:42:25.324Z", "updated": "2015-08-24T18:42:25.324Z", "description": "A configuration useful for ingesting IBM press releases.", "conversions": { "html": { "exclude_tags_keep_content": [ "span" ], "exclude_content": { "xpaths": [ "/home" ] } }, "segment": { "enabled": true, "annotated_fields": [ "custom-field-1", "custom-field-2" ] }, "json_normalizations": [ { "operation": "move", "source_field": "extracted_metadata.title", "destination_field": "metadata.title" }, { "operation": "move", "source_field": "extracted_metadata.author", "destination_field": "metadata.author" }, { "operation": "remove", "source_field": "extracted_metadata" } ] }, "enrichments": [ { "enrichment": "natural_language_understanding", "source_field": "title", "destination_field": "enriched_title", "options": { "features": { "keywords": { "sentiment": true, "emotion": false, "limit": 50 }, "entities": { "sentiment": true, "emotion": false, "limit": 50, "mentions": true, "mention_types": true, "sentence_locations": true, "model": "WKS-model-id" }, "sentiment": { "document": true, "targets": [ "IBM", "Watson" ] }, "emotion": { "document": true, "targets": [ "IBM", "Watson" ] }, "categories": {}, "concepts": { "limit": 8 }, "semantic_roles": { "entities": true, "keywords": true, "limit": 50 }, "relations": { "model": "WKS-model-id" } } } } ], "normalizations": [ { "operation": "move", "source_field": "metadata.title", "destination_field": "title" }, { "operation": "move", "source_field": "metadata.author", "destination_field": "author" }, { "operation": "remove", "source_field": "html" }, { "operation": "remove_nulls" } ], "source": { "type": "salesforce", "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b", "schedule": { "enabled": true, "time_zone": "America/New_York", "frequency": "weekly" }, "options": { "site_collections": [ { "site_collection_path": "/sites/TestSiteA", "limit": 10 } ] } } }
- configurations
The unique identifier of the configuration.
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The description of the configuration, if available.
Document conversion settings.
- conversions
A list of PDF conversion settings.
- pdf
Object containing heading detection conversion settings for PDF documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- word
Object containing heading detection conversion settings for Microsoft Word documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- keepContent
An array to XPaths.
Object containing an array of XPaths.
- excludeContent
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- segment
Enables/disables the Document Segmentation feature.
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- jsonNormalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.
An array of document enrichment settings for the configuration.
- enrichments
Describes what the enrichment step does.
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- options
Object containing Natural Language Understanding features to be used.
- features
An object specifying the Keyword enrichment and related parameters.
- keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- semanticRoles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Possible values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Possible values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- siteCollections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Possible values: [
gentle
,normal
,aggressive
]When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
The maximum milliseconds to wait for a response from the web server.
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
Object containing an array of available configurations.
An array of configurations that are available for the service instance.
Examples:{ "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e", "name": "IBM News", "created": "2015-08-24T18:42:25.324Z", "updated": "2015-08-24T18:42:25.324Z", "description": "A configuration useful for ingesting IBM press releases.", "conversions": { "html": { "exclude_tags_keep_content": [ "span" ], "exclude_content": { "xpaths": [ "/home" ] } }, "segment": { "enabled": true, "annotated_fields": [ "custom-field-1", "custom-field-2" ] }, "json_normalizations": [ { "operation": "move", "source_field": "extracted_metadata.title", "destination_field": "metadata.title" }, { "operation": "move", "source_field": "extracted_metadata.author", "destination_field": "metadata.author" }, { "operation": "remove", "source_field": "extracted_metadata" } ] }, "enrichments": [ { "enrichment": "natural_language_understanding", "source_field": "title", "destination_field": "enriched_title", "options": { "features": { "keywords": { "sentiment": true, "emotion": false, "limit": 50 }, "entities": { "sentiment": true, "emotion": false, "limit": 50, "mentions": true, "mention_types": true, "sentence_locations": true, "model": "WKS-model-id" }, "sentiment": { "document": true, "targets": [ "IBM", "Watson" ] }, "emotion": { "document": true, "targets": [ "IBM", "Watson" ] }, "categories": {}, "concepts": { "limit": 8 }, "semantic_roles": { "entities": true, "keywords": true, "limit": 50 }, "relations": { "model": "WKS-model-id" } } } } ], "normalizations": [ { "operation": "move", "source_field": "metadata.title", "destination_field": "title" }, { "operation": "move", "source_field": "metadata.author", "destination_field": "author" }, { "operation": "remove", "source_field": "html" }, { "operation": "remove_nulls" } ], "source": { "type": "salesforce", "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b", "schedule": { "enabled": true, "time_zone": "America/New_York", "frequency": "weekly" }, "options": { "site_collections": [ { "site_collection_path": "/sites/TestSiteA", "limit": 10 } ] } } }
- configurations
The unique identifier of the configuration.
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The description of the configuration, if available.
Document conversion settings.
- conversions
A list of PDF conversion settings.
- pdf
Object containing heading detection conversion settings for PDF documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- word
Object containing heading detection conversion settings for Microsoft Word documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- keep_content
An array to XPaths.
Object containing an array of XPaths.
- exclude_content
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- segment
Enables/disables the Document Segmentation feature.
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- json_normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.
An array of document enrichment settings for the configuration.
- enrichments
Describes what the enrichment step does.
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- options
Object containing Natural Language Understanding features to be used.
- features
An object specifying the Keyword enrichment and related parameters.
- keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- semantic_roles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Possible values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Possible values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- site_collections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Possible values: [
gentle
,normal
,aggressive
]When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
The maximum milliseconds to wait for a response from the web server.
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
Object containing an array of available configurations.
An array of configurations that are available for the service instance.
Examples:{ "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e", "name": "IBM News", "created": "2015-08-24T18:42:25.324Z", "updated": "2015-08-24T18:42:25.324Z", "description": "A configuration useful for ingesting IBM press releases.", "conversions": { "html": { "exclude_tags_keep_content": [ "span" ], "exclude_content": { "xpaths": [ "/home" ] } }, "segment": { "enabled": true, "annotated_fields": [ "custom-field-1", "custom-field-2" ] }, "json_normalizations": [ { "operation": "move", "source_field": "extracted_metadata.title", "destination_field": "metadata.title" }, { "operation": "move", "source_field": "extracted_metadata.author", "destination_field": "metadata.author" }, { "operation": "remove", "source_field": "extracted_metadata" } ] }, "enrichments": [ { "enrichment": "natural_language_understanding", "source_field": "title", "destination_field": "enriched_title", "options": { "features": { "keywords": { "sentiment": true, "emotion": false, "limit": 50 }, "entities": { "sentiment": true, "emotion": false, "limit": 50, "mentions": true, "mention_types": true, "sentence_locations": true, "model": "WKS-model-id" }, "sentiment": { "document": true, "targets": [ "IBM", "Watson" ] }, "emotion": { "document": true, "targets": [ "IBM", "Watson" ] }, "categories": {}, "concepts": { "limit": 8 }, "semantic_roles": { "entities": true, "keywords": true, "limit": 50 }, "relations": { "model": "WKS-model-id" } } } } ], "normalizations": [ { "operation": "move", "source_field": "metadata.title", "destination_field": "title" }, { "operation": "move", "source_field": "metadata.author", "destination_field": "author" }, { "operation": "remove", "source_field": "html" }, { "operation": "remove_nulls" } ], "source": { "type": "salesforce", "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b", "schedule": { "enabled": true, "time_zone": "America/New_York", "frequency": "weekly" }, "options": { "site_collections": [ { "site_collection_path": "/sites/TestSiteA", "limit": 10 } ] } } }
- configurations
The unique identifier of the configuration.
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The description of the configuration, if available.
Document conversion settings.
- conversions
A list of PDF conversion settings.
- pdf
Object containing heading detection conversion settings for PDF documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- word
Object containing heading detection conversion settings for Microsoft Word documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- keep_content
An array to XPaths.
Object containing an array of XPaths.
- exclude_content
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- segment
Enables/disables the Document Segmentation feature.
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- json_normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.
An array of document enrichment settings for the configuration.
- enrichments
Describes what the enrichment step does.
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- options
Object containing Natural Language Understanding features to be used.
- features
An object specifying the Keyword enrichment and related parameters.
- keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- semantic_roles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Possible values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Possible values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- site_collections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Possible values: [
gentle
,normal
,aggressive
]When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
The maximum milliseconds to wait for a response from the web server.
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
Object containing an array of available configurations.
An array of configurations that are available for the service instance.
Examples:{ "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e", "name": "IBM News", "created": "2015-08-24T18:42:25.324Z", "updated": "2015-08-24T18:42:25.324Z", "description": "A configuration useful for ingesting IBM press releases.", "conversions": { "html": { "exclude_tags_keep_content": [ "span" ], "exclude_content": { "xpaths": [ "/home" ] } }, "segment": { "enabled": true, "annotated_fields": [ "custom-field-1", "custom-field-2" ] }, "json_normalizations": [ { "operation": "move", "source_field": "extracted_metadata.title", "destination_field": "metadata.title" }, { "operation": "move", "source_field": "extracted_metadata.author", "destination_field": "metadata.author" }, { "operation": "remove", "source_field": "extracted_metadata" } ] }, "enrichments": [ { "enrichment": "natural_language_understanding", "source_field": "title", "destination_field": "enriched_title", "options": { "features": { "keywords": { "sentiment": true, "emotion": false, "limit": 50 }, "entities": { "sentiment": true, "emotion": false, "limit": 50, "mentions": true, "mention_types": true, "sentence_locations": true, "model": "WKS-model-id" }, "sentiment": { "document": true, "targets": [ "IBM", "Watson" ] }, "emotion": { "document": true, "targets": [ "IBM", "Watson" ] }, "categories": {}, "concepts": { "limit": 8 }, "semantic_roles": { "entities": true, "keywords": true, "limit": 50 }, "relations": { "model": "WKS-model-id" } } } } ], "normalizations": [ { "operation": "move", "source_field": "metadata.title", "destination_field": "title" }, { "operation": "move", "source_field": "metadata.author", "destination_field": "author" }, { "operation": "remove", "source_field": "html" }, { "operation": "remove_nulls" } ], "source": { "type": "salesforce", "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b", "schedule": { "enabled": true, "time_zone": "America/New_York", "frequency": "weekly" }, "options": { "site_collections": [ { "site_collection_path": "/sites/TestSiteA", "limit": 10 } ] } } }
- Configurations
The unique identifier of the configuration.
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The description of the configuration, if available.
Document conversion settings.
- Conversions
A list of PDF conversion settings.
- Pdf
Object containing heading detection conversion settings for PDF documents.
- Heading
Array of font matching configurations.
- Fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- Word
Object containing heading detection conversion settings for Microsoft Word documents.
- Heading
Array of font matching configurations.
- Fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- Styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- Html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- KeepContent
An array to XPaths.
Object containing an array of XPaths.
- ExcludeContent
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- Segment
Enables/disables the Document Segmentation feature.
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- JsonNormalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.
An array of document enrichment settings for the configuration.
- Enrichments
Describes what the enrichment step does.
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- Options
Object containing Natural Language Understanding features to be used.
- Features
An object specifying the Keyword enrichment and related parameters.
- Keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- Entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- Sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- Emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- SemanticRoles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- Relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- Concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Possible values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- Normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- Source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- Schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Possible values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- Options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- Folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- Objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- SiteCollections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- Urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Possible values: [
gentle
,normal
,aggressive
]When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
The maximum milliseconds to wait for a response from the web server.
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- Buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
Status Code
Successful response.
Bad request.
No Sample Response
Get configuration details
GET /v1/environments/{environment_id}/configurations/{configuration_id}
ServiceCall<Configuration> getConfiguration(GetConfigurationOptions getConfigurationOptions)
getConfiguration(params)
get_configuration(
self,
environment_id: str,
configuration_id: str,
**kwargs,
) -> DetailedResponse
GetConfiguration(string environmentId, string configurationId)
Request
Use the GetConfigurationOptions.Builder
to create a GetConfigurationOptions
object that contains the parameter values for the getConfiguration
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the configuration.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The getConfiguration options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the configuration.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the configuration.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the configuration.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the configuration.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/configurations/{configuration_id}?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.GetConfiguration( environmentId: "{environmentId}", configurationId: "{configurationId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String configurationId = "{configuration_id}"; GetConfigurationOptions getOptions = new GetConfigurationOptions.Builder(environmentId, configurationId).build(); Configuration getResponse = discovery.getConfiguration(getOptions).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const getConfigurationParams = { environmentId: '{environment_id}', configurationId: '{configuration_id}', }; discovery.getConfiguration(getConfigurationParams) .then(configuration => { console.log(JSON.stringify(configuration, null, 2)); }) .catch(err => { console.log('error:', err); });
import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') config = discovery.get_configuration( '{environment_id}', '{configuration_id}').get_result() print(json.dumps(config, indent=2))
Response
A custom configuration for the environment.
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The unique identifier of the configuration
The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
The description of the configuration, if available.
Document conversion settings.
An array of document enrichment settings for the configuration.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
Object containing source parameters for the configuration.
A custom configuration for the environment.
{
"configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
"name": "IBM News",
"created": "2015-08-24T18:42:25.324Z",
"updated": "2015-08-24T18:42:25.324Z",
"description": "A configuration useful for ingesting IBM press releases.",
"conversions": {
"html": {
"exclude_tags_keep_content": [
"span"
],
"exclude_content": {
"xpaths": [
"/home"
]
}
},
"segment": {
"enabled": true,
"annotated_fields": [
"custom-field-1",
"custom-field-2"
]
},
"json_normalizations": [
{
"operation": "move",
"source_field": "extracted_metadata.title",
"destination_field": "metadata.title"
},
{
"operation": "move",
"source_field": "extracted_metadata.author",
"destination_field": "metadata.author"
},
{
"operation": "remove",
"source_field": "extracted_metadata"
}
]
},
"enrichments": [
{
"enrichment": "natural_language_understanding",
"source_field": "title",
"destination_field": "enriched_title",
"options": {
"features": {
"keywords": {
"sentiment": true,
"emotion": false,
"limit": 50
},
"entities": {
"sentiment": true,
"emotion": false,
"limit": 50,
"mentions": true,
"mention_types": true,
"sentence_locations": true,
"model": "WKS-model-id"
},
"sentiment": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"emotion": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"categories": {},
"concepts": {
"limit": 8
},
"semantic_roles": {
"entities": true,
"keywords": true,
"limit": 50
},
"relations": {
"model": "WKS-model-id"
}
}
}
}
],
"normalizations": [
{
"operation": "move",
"source_field": "metadata.title",
"destination_field": "title"
},
{
"operation": "move",
"source_field": "metadata.author",
"destination_field": "author"
},
{
"operation": "remove",
"source_field": "html"
},
{
"operation": "remove_nulls"
}
],
"source": {
"type": "salesforce",
"credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
"schedule": {
"enabled": true,
"time_zone": "America/New_York",
"frequency": "weekly"
},
"options": {
"site_collections": [
{
"site_collection_path": "/sites/TestSiteA",
"limit": 10
}
]
}
}
}
The unique identifier of the configuration.
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The description of the configuration, if available.
Document conversion settings.
- conversions
A list of PDF conversion settings.
- pdf
Object containing heading detection conversion settings for PDF documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- word
Object containing heading detection conversion settings for Microsoft Word documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- keepContent
An array to XPaths.
Object containing an array of XPaths.
- excludeContent
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- segment
Enables/disables the Document Segmentation feature.
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- jsonNormalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.
An array of document enrichment settings for the configuration.
- enrichments
Describes what the enrichment step does.
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- options
Object containing Natural Language Understanding features to be used.
- features
An object specifying the Keyword enrichment and related parameters.
- keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- semanticRoles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Possible values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Possible values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- siteCollections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Possible values: [
gentle
,normal
,aggressive
]When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
The maximum milliseconds to wait for a response from the web server.
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
A custom configuration for the environment.
{
"configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
"name": "IBM News",
"created": "2015-08-24T18:42:25.324Z",
"updated": "2015-08-24T18:42:25.324Z",
"description": "A configuration useful for ingesting IBM press releases.",
"conversions": {
"html": {
"exclude_tags_keep_content": [
"span"
],
"exclude_content": {
"xpaths": [
"/home"
]
}
},
"segment": {
"enabled": true,
"annotated_fields": [
"custom-field-1",
"custom-field-2"
]
},
"json_normalizations": [
{
"operation": "move",
"source_field": "extracted_metadata.title",
"destination_field": "metadata.title"
},
{
"operation": "move",
"source_field": "extracted_metadata.author",
"destination_field": "metadata.author"
},
{
"operation": "remove",
"source_field": "extracted_metadata"
}
]
},
"enrichments": [
{
"enrichment": "natural_language_understanding",
"source_field": "title",
"destination_field": "enriched_title",
"options": {
"features": {
"keywords": {
"sentiment": true,
"emotion": false,
"limit": 50
},
"entities": {
"sentiment": true,
"emotion": false,
"limit": 50,
"mentions": true,
"mention_types": true,
"sentence_locations": true,
"model": "WKS-model-id"
},
"sentiment": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"emotion": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"categories": {},
"concepts": {
"limit": 8
},
"semantic_roles": {
"entities": true,
"keywords": true,
"limit": 50
},
"relations": {
"model": "WKS-model-id"
}
}
}
}
],
"normalizations": [
{
"operation": "move",
"source_field": "metadata.title",
"destination_field": "title"
},
{
"operation": "move",
"source_field": "metadata.author",
"destination_field": "author"
},
{
"operation": "remove",
"source_field": "html"
},
{
"operation": "remove_nulls"
}
],
"source": {
"type": "salesforce",
"credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
"schedule": {
"enabled": true,
"time_zone": "America/New_York",
"frequency": "weekly"
},
"options": {
"site_collections": [
{
"site_collection_path": "/sites/TestSiteA",
"limit": 10
}
]
}
}
}
The unique identifier of the configuration.
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The description of the configuration, if available.
Document conversion settings.
- conversions
A list of PDF conversion settings.
- pdf
Object containing heading detection conversion settings for PDF documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- word
Object containing heading detection conversion settings for Microsoft Word documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- keep_content
An array to XPaths.
Object containing an array of XPaths.
- exclude_content
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- segment
Enables/disables the Document Segmentation feature.
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- json_normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.
An array of document enrichment settings for the configuration.
- enrichments
Describes what the enrichment step does.
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- options
Object containing Natural Language Understanding features to be used.
- features
An object specifying the Keyword enrichment and related parameters.
- keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- semantic_roles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Possible values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Possible values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- site_collections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Possible values: [
gentle
,normal
,aggressive
]When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
The maximum milliseconds to wait for a response from the web server.
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
A custom configuration for the environment.
{
"configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
"name": "IBM News",
"created": "2015-08-24T18:42:25.324Z",
"updated": "2015-08-24T18:42:25.324Z",
"description": "A configuration useful for ingesting IBM press releases.",
"conversions": {
"html": {
"exclude_tags_keep_content": [
"span"
],
"exclude_content": {
"xpaths": [
"/home"
]
}
},
"segment": {
"enabled": true,
"annotated_fields": [
"custom-field-1",
"custom-field-2"
]
},
"json_normalizations": [
{
"operation": "move",
"source_field": "extracted_metadata.title",
"destination_field": "metadata.title"
},
{
"operation": "move",
"source_field": "extracted_metadata.author",
"destination_field": "metadata.author"
},
{
"operation": "remove",
"source_field": "extracted_metadata"
}
]
},
"enrichments": [
{
"enrichment": "natural_language_understanding",
"source_field": "title",
"destination_field": "enriched_title",
"options": {
"features": {
"keywords": {
"sentiment": true,
"emotion": false,
"limit": 50
},
"entities": {
"sentiment": true,
"emotion": false,
"limit": 50,
"mentions": true,
"mention_types": true,
"sentence_locations": true,
"model": "WKS-model-id"
},
"sentiment": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"emotion": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"categories": {},
"concepts": {
"limit": 8
},
"semantic_roles": {
"entities": true,
"keywords": true,
"limit": 50
},
"relations": {
"model": "WKS-model-id"
}
}
}
}
],
"normalizations": [
{
"operation": "move",
"source_field": "metadata.title",
"destination_field": "title"
},
{
"operation": "move",
"source_field": "metadata.author",
"destination_field": "author"
},
{
"operation": "remove",
"source_field": "html"
},
{
"operation": "remove_nulls"
}
],
"source": {
"type": "salesforce",
"credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
"schedule": {
"enabled": true,
"time_zone": "America/New_York",
"frequency": "weekly"
},
"options": {
"site_collections": [
{
"site_collection_path": "/sites/TestSiteA",
"limit": 10
}
]
}
}
}
The unique identifier of the configuration.
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The description of the configuration, if available.
Document conversion settings.
- conversions
A list of PDF conversion settings.
- pdf
Object containing heading detection conversion settings for PDF documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- word
Object containing heading detection conversion settings for Microsoft Word documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- keep_content
An array to XPaths.
Object containing an array of XPaths.
- exclude_content
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- segment
Enables/disables the Document Segmentation feature.
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- json_normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.
An array of document enrichment settings for the configuration.
- enrichments
Describes what the enrichment step does.
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- options
Object containing Natural Language Understanding features to be used.
- features
An object specifying the Keyword enrichment and related parameters.
- keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- semantic_roles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Possible values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Possible values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- site_collections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Possible values: [
gentle
,normal
,aggressive
]When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
The maximum milliseconds to wait for a response from the web server.
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
A custom configuration for the environment.
{
"configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
"name": "IBM News",
"created": "2015-08-24T18:42:25.324Z",
"updated": "2015-08-24T18:42:25.324Z",
"description": "A configuration useful for ingesting IBM press releases.",
"conversions": {
"html": {
"exclude_tags_keep_content": [
"span"
],
"exclude_content": {
"xpaths": [
"/home"
]
}
},
"segment": {
"enabled": true,
"annotated_fields": [
"custom-field-1",
"custom-field-2"
]
},
"json_normalizations": [
{
"operation": "move",
"source_field": "extracted_metadata.title",
"destination_field": "metadata.title"
},
{
"operation": "move",
"source_field": "extracted_metadata.author",
"destination_field": "metadata.author"
},
{
"operation": "remove",
"source_field": "extracted_metadata"
}
]
},
"enrichments": [
{
"enrichment": "natural_language_understanding",
"source_field": "title",
"destination_field": "enriched_title",
"options": {
"features": {
"keywords": {
"sentiment": true,
"emotion": false,
"limit": 50
},
"entities": {
"sentiment": true,
"emotion": false,
"limit": 50,
"mentions": true,
"mention_types": true,
"sentence_locations": true,
"model": "WKS-model-id"
},
"sentiment": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"emotion": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"categories": {},
"concepts": {
"limit": 8
},
"semantic_roles": {
"entities": true,
"keywords": true,
"limit": 50
},
"relations": {
"model": "WKS-model-id"
}
}
}
}
],
"normalizations": [
{
"operation": "move",
"source_field": "metadata.title",
"destination_field": "title"
},
{
"operation": "move",
"source_field": "metadata.author",
"destination_field": "author"
},
{
"operation": "remove",
"source_field": "html"
},
{
"operation": "remove_nulls"
}
],
"source": {
"type": "salesforce",
"credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
"schedule": {
"enabled": true,
"time_zone": "America/New_York",
"frequency": "weekly"
},
"options": {
"site_collections": [
{
"site_collection_path": "/sites/TestSiteA",
"limit": 10
}
]
}
}
}
The unique identifier of the configuration.
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The description of the configuration, if available.
Document conversion settings.
- Conversions
A list of PDF conversion settings.
- Pdf
Object containing heading detection conversion settings for PDF documents.
- Heading
Array of font matching configurations.
- Fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- Word
Object containing heading detection conversion settings for Microsoft Word documents.
- Heading
Array of font matching configurations.
- Fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- Styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- Html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- KeepContent
An array to XPaths.
Object containing an array of XPaths.
- ExcludeContent
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- Segment
Enables/disables the Document Segmentation feature.
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- JsonNormalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.
An array of document enrichment settings for the configuration.
- Enrichments
Describes what the enrichment step does.
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- Options
Object containing Natural Language Understanding features to be used.
- Features
An object specifying the Keyword enrichment and related parameters.
- Keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- Entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- Sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- Emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- SemanticRoles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- Relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- Concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Possible values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- Normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- Source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- Schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Possible values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- Options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- Folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- Objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- SiteCollections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- Urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Possible values: [
gentle
,normal
,aggressive
]When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
The maximum milliseconds to wait for a response from the web server.
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- Buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
Status Code
Configuration successfully fetched.
Bad request.
{ "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e", "name": "IBM News", "created": "2015-08-24T18:42:25.324Z", "updated": "2015-08-24T18:42:25.324Z", "description": "A configuration useful for ingesting IBM press releases.", "conversions": { "html": { "exclude_tags_keep_content": [ "span" ], "exclude_content": { "xpaths": [ "/home" ] } }, "segment": { "enabled": true, "annotated_fields": [ "custom-field-1", "custom-field-2" ] }, "json_normalizations": [ { "operation": "move", "source_field": "extracted_metadata.title", "destination_field": "metadata.title" }, { "operation": "move", "source_field": "extracted_metadata.author", "destination_field": "metadata.author" }, { "operation": "remove", "source_field": "extracted_metadata" } ] }, "enrichments": [ { "enrichment": "natural_language_understanding", "source_field": "title", "destination_field": "enriched_title", "options": { "features": { "keywords": { "sentiment": true, "emotion": false, "limit": 50 }, "entities": { "sentiment": true, "emotion": false, "limit": 50, "mentions": true, "mention_types": true, "sentence_locations": true, "model": "WKS-model-id" }, "sentiment": { "document": true, "targets": [ "IBM", "Watson" ] }, "emotion": { "document": true, "targets": [ "IBM", "Watson" ] }, "categories": {}, "concepts": { "limit": 8 }, "semantic_roles": { "entities": true, "keywords": true, "limit": 50 }, "relations": { "model": "WKS-model-id" } } } } ], "normalizations": [ { "operation": "move", "source_field": "metadata.title", "destination_field": "title" }, { "operation": "move", "source_field": "metadata.author", "destination_field": "author" }, { "operation": "remove", "source_field": "html" }, { "operation": "remove_nulls" } ], "source": { "type": "salesforce", "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b", "schedule": { "enabled": true, "time_zone": "America/New_York", "frequency": "weekly" }, "options": { "site_collections": [ { "site_collection_path": "/sites/TestSiteA", "limit": 10 } ] } } }
{ "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e", "name": "IBM News", "created": "2015-08-24T18:42:25.324Z", "updated": "2015-08-24T18:42:25.324Z", "description": "A configuration useful for ingesting IBM press releases.", "conversions": { "html": { "exclude_tags_keep_content": [ "span" ], "exclude_content": { "xpaths": [ "/home" ] } }, "segment": { "enabled": true, "annotated_fields": [ "custom-field-1", "custom-field-2" ] }, "json_normalizations": [ { "operation": "move", "source_field": "extracted_metadata.title", "destination_field": "metadata.title" }, { "operation": "move", "source_field": "extracted_metadata.author", "destination_field": "metadata.author" }, { "operation": "remove", "source_field": "extracted_metadata" } ] }, "enrichments": [ { "enrichment": "natural_language_understanding", "source_field": "title", "destination_field": "enriched_title", "options": { "features": { "keywords": { "sentiment": true, "emotion": false, "limit": 50 }, "entities": { "sentiment": true, "emotion": false, "limit": 50, "mentions": true, "mention_types": true, "sentence_locations": true, "model": "WKS-model-id" }, "sentiment": { "document": true, "targets": [ "IBM", "Watson" ] }, "emotion": { "document": true, "targets": [ "IBM", "Watson" ] }, "categories": {}, "concepts": { "limit": 8 }, "semantic_roles": { "entities": true, "keywords": true, "limit": 50 }, "relations": { "model": "WKS-model-id" } } } } ], "normalizations": [ { "operation": "move", "source_field": "metadata.title", "destination_field": "title" }, { "operation": "move", "source_field": "metadata.author", "destination_field": "author" }, { "operation": "remove", "source_field": "html" }, { "operation": "remove_nulls" } ], "source": { "type": "salesforce", "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b", "schedule": { "enabled": true, "time_zone": "America/New_York", "frequency": "weekly" }, "options": { "site_collections": [ { "site_collection_path": "/sites/TestSiteA", "limit": 10 } ] } } }
Update a configuration
Replaces an existing configuration.
- Completely replaces the original configuration.
- The configuration_id, updated, and created fields are accepted in the request, but they are ignored, and an error is not generated. It is also acceptable for users to submit an updated configuration with none of the three properties.
- Documents are processed with a snapshot of the configuration as it was at the time the document was submitted to be ingested. This means that already submitted documents will not see any updates made to the configuration.
Replaces an existing configuration.
- Completely replaces the original configuration.
- The configuration_id, updated, and created fields are accepted in the request, but they are ignored, and an error is not generated. It is also acceptable for users to submit an updated configuration with none of the three properties.
- Documents are processed with a snapshot of the configuration as it was at the time the document was submitted to be ingested. This means that already submitted documents will not see any updates made to the configuration.
Replaces an existing configuration.
- Completely replaces the original configuration.
- The configuration_id, updated, and created fields are accepted in the request, but they are ignored, and an error is not generated. It is also acceptable for users to submit an updated configuration with none of the three properties.
- Documents are processed with a snapshot of the configuration as it was at the time the document was submitted to be ingested. This means that already submitted documents will not see any updates made to the configuration.
Replaces an existing configuration.
- Completely replaces the original configuration.
- The configuration_id, updated, and created fields are accepted in the request, but they are ignored, and an error is not generated. It is also acceptable for users to submit an updated configuration with none of the three properties.
- Documents are processed with a snapshot of the configuration as it was at the time the document was submitted to be ingested. This means that already submitted documents will not see any updates made to the configuration.
Replaces an existing configuration.
- Completely replaces the original configuration.
- The configuration_id, updated, and created fields are accepted in the request, but they are ignored, and an error is not generated. It is also acceptable for users to submit an updated configuration with none of the three properties.
- Documents are processed with a snapshot of the configuration as it was at the time the document was submitted to be ingested. This means that already submitted documents will not see any updates made to the configuration.
PUT /v1/environments/{environment_id}/configurations/{configuration_id}
ServiceCall<Configuration> updateConfiguration(UpdateConfigurationOptions updateConfigurationOptions)
updateConfiguration(params)
update_configuration(
self,
environment_id: str,
configuration_id: str,
name: str,
*,
description: str = None,
conversions: 'Conversions' = None,
enrichments: List['Enrichment'] = None,
normalizations: List['NormalizationOperation'] = None,
source: 'Source' = None,
**kwargs,
) -> DetailedResponse
UpdateConfiguration(string environmentId, string configurationId, string name, string description = null, Conversions conversions = null, List<Enrichment> enrichments = null, List<NormalizationOperation> normalizations = null, Source source = null)
Request
Use the UpdateConfigurationOptions.Builder
to create a UpdateConfigurationOptions
object that contains the parameter values for the updateConfiguration
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the configuration.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
Input an object that enables you to update and customize how your data is ingested and what enrichments are added to your data. The name parameter is required and must be unique within the current environment. All other properties are optional, but if they are omitted the default values replace the current value of each omitted property.
If the input configuration contains the configuration_id, created, or updated properties, they are ignored and overridden by the system, and an error is not returned so that the overridden fields do not need to be removed when updating a configuration.
The configuration can contain unrecognized JSON fields. Any such fields are ignored and do not generate an error. This makes it easier to use newer configuration files with older versions of the API and the service. It also makes it possible for the tooling to add additional metadata and information to the configuration.
{
"configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
"name": "IBM News",
"created": "2015-08-24T18:42:25.324Z",
"updated": "2015-08-24T18:42:25.324Z",
"description": "A configuration useful for ingesting IBM press releases.",
"conversions": {
"html": {
"exclude_tags_keep_content": [
"span"
],
"exclude_content": {
"xpaths": [
"/home"
]
}
},
"segment": {
"enabled": true,
"annotated_fields": [
"custom-field-1",
"custom-field-2"
]
},
"json_normalizations": [
{
"operation": "move",
"source_field": "extracted_metadata.title",
"destination_field": "metadata.title"
},
{
"operation": "move",
"source_field": "extracted_metadata.author",
"destination_field": "metadata.author"
},
{
"operation": "remove",
"source_field": "extracted_metadata"
}
]
},
"enrichments": [
{
"enrichment": "natural_language_understanding",
"source_field": "title",
"destination_field": "enriched_title",
"options": {
"features": {
"keywords": {
"sentiment": true,
"emotion": false,
"limit": 50
},
"entities": {
"sentiment": true,
"emotion": false,
"limit": 50,
"mentions": true,
"mention_types": true,
"sentence_locations": true,
"model": "WKS-model-id"
},
"sentiment": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"emotion": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"categories": {},
"concepts": {
"limit": 8
},
"semantic_roles": {
"entities": true,
"keywords": true,
"limit": 50
},
"relations": {
"model": "WKS-model-id"
}
}
}
}
],
"normalizations": [
{
"operation": "move",
"source_field": "metadata.title",
"destination_field": "title"
},
{
"operation": "move",
"source_field": "metadata.author",
"destination_field": "author"
},
{
"operation": "remove",
"source_field": "html"
},
{
"operation": "remove_nulls"
}
],
"source": {
"type": "salesforce",
"credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
"schedule": {
"enabled": true,
"time_zone": "America/New_York",
"frequency": "weekly"
},
"options": {
"site_collections": [
{
"site_collection_path": "/sites/TestSiteA",
"limit": 10
}
]
}
}
}
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The description of the configuration, if available.
Document conversion settings.
An array of document enrichment settings for the configuration.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
Object containing source parameters for the configuration.
The updateConfiguration options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the configuration.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The description of the configuration, if available.
Document conversion settings.
- conversions
A list of PDF conversion settings.
- pdf
Object containing heading detection conversion settings for PDF documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- word
Object containing heading detection conversion settings for Microsoft Word documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- keepContent
An array to XPaths.
Object containing an array of XPaths.
- excludeContent
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- segment
Enables/disables the Document Segmentation feature.
Default:
false
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Default:
["h1","h2"]
Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- jsonNormalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Allowable values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.Default:
true
An array of document enrichment settings for the configuration.
- enrichments
Describes what the enrichment step does.
Default:
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Default:
false
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Default:
false
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- options
Object containing Natural Language Understanding features to be used.
- features
An object specifying the Keyword enrichment and related parameters.
- keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- semanticRoles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Allowable values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Allowable values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Allowable values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.Default:
true
The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
Default:
America/New_York
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Allowable values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- siteCollections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.Default:
true
The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Allowable values: [
gentle
,normal
,aggressive
]Default:
normal
When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.Default:
false
The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
Default:
2
The maximum milliseconds to wait for a response from the web server.
Default:
30000
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Default:
false
Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the configuration.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The description of the configuration, if available.
Document conversion settings.
- conversions
A list of PDF conversion settings.
- pdf
Object containing heading detection conversion settings for PDF documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- word
Object containing heading detection conversion settings for Microsoft Word documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- keep_content
An array to XPaths.
Object containing an array of XPaths.
- exclude_content
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- segment
Enables/disables the Document Segmentation feature.
Default:
false
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Default:
["h1","h2"]
Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- json_normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Allowable values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.Default:
true
An array of document enrichment settings for the configuration.
- enrichments
Describes what the enrichment step does.
Default:
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Default:
false
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Default:
false
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- options
Object containing Natural Language Understanding features to be used.
- features
An object specifying the Keyword enrichment and related parameters.
- keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- semantic_roles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Allowable values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Allowable values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Allowable values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.Default:
true
The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
Default:
America/New_York
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Allowable values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- site_collections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.Default:
true
The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Allowable values: [
gentle
,normal
,aggressive
]Default:
normal
When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.Default:
false
The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
Default:
2
The maximum milliseconds to wait for a response from the web server.
Default:
30000
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Default:
false
Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the configuration.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The description of the configuration, if available.
Document conversion settings.
- conversions
A list of PDF conversion settings.
- pdf
Object containing heading detection conversion settings for PDF documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- word
Object containing heading detection conversion settings for Microsoft Word documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- keep_content
An array to XPaths.
Object containing an array of XPaths.
- exclude_content
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- segment
Enables/disables the Document Segmentation feature.
Default:
false
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Default:
["h1","h2"]
Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- json_normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Allowable values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.Default:
true
An array of document enrichment settings for the configuration.
- enrichments
Describes what the enrichment step does.
Default:
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Default:
false
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Default:
false
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- options
Object containing Natural Language Understanding features to be used.
- features
An object specifying the Keyword enrichment and related parameters.
- keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- semantic_roles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Allowable values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Allowable values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Allowable values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.Default:
true
The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
Default:
America/New_York
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Allowable values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- site_collections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.Default:
true
The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Allowable values: [
gentle
,normal
,aggressive
]Default:
normal
When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.Default:
false
The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
Default:
2
The maximum milliseconds to wait for a response from the web server.
Default:
30000
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Default:
false
Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the configuration.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The description of the configuration, if available.
Document conversion settings.
- conversions
A list of PDF conversion settings.
- Pdf
Object containing heading detection conversion settings for PDF documents.
- Heading
Array of font matching configurations.
- Fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- Word
Object containing heading detection conversion settings for Microsoft Word documents.
- Heading
Array of font matching configurations.
- Fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- Styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- Html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- KeepContent
An array to XPaths.
Object containing an array of XPaths.
- ExcludeContent
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- Segment
Enables/disables the Document Segmentation feature.
Default:
false
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Default:
["h1","h2"]
Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- JsonNormalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Allowable values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.Default:
true
An array of document enrichment settings for the configuration.
- enrichments
Describes what the enrichment step does.
Default:
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Default:
false
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Default:
false
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- Options
Object containing Natural Language Understanding features to be used.
- Features
An object specifying the Keyword enrichment and related parameters.
- Keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- Entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- Sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- Emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- SemanticRoles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- Relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- Concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Allowable values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Allowable values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Allowable values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- Schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.Default:
true
The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
Default:
America/New_York
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Allowable values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- Options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- Folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- Objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- SiteCollections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- Urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.Default:
true
The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Allowable values: [
gentle
,normal
,aggressive
]Default:
normal
When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.Default:
false
The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
Default:
2
The maximum milliseconds to wait for a response from the web server.
Default:
30000
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Default:
false
Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- Buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
curl -X PUT -u "apikey":"{apikey}" -H "Content-Type: application/json" -d @new_config.json "{url}/v1/environments/{environment_id}/configurations/{configuration_id}?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.UpdateConfiguration( environmentId: "{environmentId}", configurationId: "{configurationId}", name: "new-config" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String configurationId = "{configuration_id}"; String updatedConfigurationName = "new-config"; Configuration updatedConfiguration = GsonSingleton.getGson().fromJson( new FileReader("{updatedConfigFilePath}"), com.ibm.watson.internal.discovery.model.configuration.Configuration.class); UpdateConfigurationOptions.Builder updateBuilder = new UpdateConfigurationOptions.Builder(environmentId, configurationId, updatedConfigurationName); updateBuilder.configuration(updatedConfiguration); Configuration updateResponse = discovery.updateConfiguration(updateBuilder.build()).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const updateConfigurationParams = { environmentId: '{environment_id}', configurationId: '{configuration_id}', name: '{updated or original name if updating another parameter (name is required)}', }; discovery.updateConfiguration(updateConfigurationParams) .then(configuration => { console.log(JSON.stringify(configuration, null, 2)); }) .catch(err => { console.log('error:', err); });
import os import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') with open(os.path.join(os.getcwd(), 'config_update.json')) as config_data: data = json.load(config_data) updated_config = discovery.update_configuration( '{environment_id}', '{configuration_id}', data['name'], description=data['description'], conversions=data['conversions'], enrichments=data['enrichments'], normalizations=data['normalizations']).get_result() print(json.dumps(updated_config, indent=2))
Response
A custom configuration for the environment.
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The unique identifier of the configuration
The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
The description of the configuration, if available.
Document conversion settings.
An array of document enrichment settings for the configuration.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
Object containing source parameters for the configuration.
A custom configuration for the environment.
{
"configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
"name": "IBM News",
"created": "2015-08-24T18:42:25.324Z",
"updated": "2015-08-24T18:42:25.324Z",
"description": "A configuration useful for ingesting IBM press releases.",
"conversions": {
"html": {
"exclude_tags_keep_content": [
"span"
],
"exclude_content": {
"xpaths": [
"/home"
]
}
},
"segment": {
"enabled": true,
"annotated_fields": [
"custom-field-1",
"custom-field-2"
]
},
"json_normalizations": [
{
"operation": "move",
"source_field": "extracted_metadata.title",
"destination_field": "metadata.title"
},
{
"operation": "move",
"source_field": "extracted_metadata.author",
"destination_field": "metadata.author"
},
{
"operation": "remove",
"source_field": "extracted_metadata"
}
]
},
"enrichments": [
{
"enrichment": "natural_language_understanding",
"source_field": "title",
"destination_field": "enriched_title",
"options": {
"features": {
"keywords": {
"sentiment": true,
"emotion": false,
"limit": 50
},
"entities": {
"sentiment": true,
"emotion": false,
"limit": 50,
"mentions": true,
"mention_types": true,
"sentence_locations": true,
"model": "WKS-model-id"
},
"sentiment": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"emotion": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"categories": {},
"concepts": {
"limit": 8
},
"semantic_roles": {
"entities": true,
"keywords": true,
"limit": 50
},
"relations": {
"model": "WKS-model-id"
}
}
}
}
],
"normalizations": [
{
"operation": "move",
"source_field": "metadata.title",
"destination_field": "title"
},
{
"operation": "move",
"source_field": "metadata.author",
"destination_field": "author"
},
{
"operation": "remove",
"source_field": "html"
},
{
"operation": "remove_nulls"
}
],
"source": {
"type": "salesforce",
"credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
"schedule": {
"enabled": true,
"time_zone": "America/New_York",
"frequency": "weekly"
},
"options": {
"site_collections": [
{
"site_collection_path": "/sites/TestSiteA",
"limit": 10
}
]
}
}
}
The unique identifier of the configuration.
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The description of the configuration, if available.
Document conversion settings.
- conversions
A list of PDF conversion settings.
- pdf
Object containing heading detection conversion settings for PDF documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- word
Object containing heading detection conversion settings for Microsoft Word documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- keepContent
An array to XPaths.
Object containing an array of XPaths.
- excludeContent
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- segment
Enables/disables the Document Segmentation feature.
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- jsonNormalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.
An array of document enrichment settings for the configuration.
- enrichments
Describes what the enrichment step does.
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- options
Object containing Natural Language Understanding features to be used.
- features
An object specifying the Keyword enrichment and related parameters.
- keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- semanticRoles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Possible values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Possible values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- siteCollections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Possible values: [
gentle
,normal
,aggressive
]When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
The maximum milliseconds to wait for a response from the web server.
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
A custom configuration for the environment.
{
"configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
"name": "IBM News",
"created": "2015-08-24T18:42:25.324Z",
"updated": "2015-08-24T18:42:25.324Z",
"description": "A configuration useful for ingesting IBM press releases.",
"conversions": {
"html": {
"exclude_tags_keep_content": [
"span"
],
"exclude_content": {
"xpaths": [
"/home"
]
}
},
"segment": {
"enabled": true,
"annotated_fields": [
"custom-field-1",
"custom-field-2"
]
},
"json_normalizations": [
{
"operation": "move",
"source_field": "extracted_metadata.title",
"destination_field": "metadata.title"
},
{
"operation": "move",
"source_field": "extracted_metadata.author",
"destination_field": "metadata.author"
},
{
"operation": "remove",
"source_field": "extracted_metadata"
}
]
},
"enrichments": [
{
"enrichment": "natural_language_understanding",
"source_field": "title",
"destination_field": "enriched_title",
"options": {
"features": {
"keywords": {
"sentiment": true,
"emotion": false,
"limit": 50
},
"entities": {
"sentiment": true,
"emotion": false,
"limit": 50,
"mentions": true,
"mention_types": true,
"sentence_locations": true,
"model": "WKS-model-id"
},
"sentiment": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"emotion": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"categories": {},
"concepts": {
"limit": 8
},
"semantic_roles": {
"entities": true,
"keywords": true,
"limit": 50
},
"relations": {
"model": "WKS-model-id"
}
}
}
}
],
"normalizations": [
{
"operation": "move",
"source_field": "metadata.title",
"destination_field": "title"
},
{
"operation": "move",
"source_field": "metadata.author",
"destination_field": "author"
},
{
"operation": "remove",
"source_field": "html"
},
{
"operation": "remove_nulls"
}
],
"source": {
"type": "salesforce",
"credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
"schedule": {
"enabled": true,
"time_zone": "America/New_York",
"frequency": "weekly"
},
"options": {
"site_collections": [
{
"site_collection_path": "/sites/TestSiteA",
"limit": 10
}
]
}
}
}
The unique identifier of the configuration.
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The description of the configuration, if available.
Document conversion settings.
- conversions
A list of PDF conversion settings.
- pdf
Object containing heading detection conversion settings for PDF documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- word
Object containing heading detection conversion settings for Microsoft Word documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- keep_content
An array to XPaths.
Object containing an array of XPaths.
- exclude_content
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- segment
Enables/disables the Document Segmentation feature.
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- json_normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.
An array of document enrichment settings for the configuration.
- enrichments
Describes what the enrichment step does.
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- options
Object containing Natural Language Understanding features to be used.
- features
An object specifying the Keyword enrichment and related parameters.
- keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- semantic_roles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Possible values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Possible values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- site_collections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Possible values: [
gentle
,normal
,aggressive
]When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
The maximum milliseconds to wait for a response from the web server.
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
A custom configuration for the environment.
{
"configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
"name": "IBM News",
"created": "2015-08-24T18:42:25.324Z",
"updated": "2015-08-24T18:42:25.324Z",
"description": "A configuration useful for ingesting IBM press releases.",
"conversions": {
"html": {
"exclude_tags_keep_content": [
"span"
],
"exclude_content": {
"xpaths": [
"/home"
]
}
},
"segment": {
"enabled": true,
"annotated_fields": [
"custom-field-1",
"custom-field-2"
]
},
"json_normalizations": [
{
"operation": "move",
"source_field": "extracted_metadata.title",
"destination_field": "metadata.title"
},
{
"operation": "move",
"source_field": "extracted_metadata.author",
"destination_field": "metadata.author"
},
{
"operation": "remove",
"source_field": "extracted_metadata"
}
]
},
"enrichments": [
{
"enrichment": "natural_language_understanding",
"source_field": "title",
"destination_field": "enriched_title",
"options": {
"features": {
"keywords": {
"sentiment": true,
"emotion": false,
"limit": 50
},
"entities": {
"sentiment": true,
"emotion": false,
"limit": 50,
"mentions": true,
"mention_types": true,
"sentence_locations": true,
"model": "WKS-model-id"
},
"sentiment": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"emotion": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"categories": {},
"concepts": {
"limit": 8
},
"semantic_roles": {
"entities": true,
"keywords": true,
"limit": 50
},
"relations": {
"model": "WKS-model-id"
}
}
}
}
],
"normalizations": [
{
"operation": "move",
"source_field": "metadata.title",
"destination_field": "title"
},
{
"operation": "move",
"source_field": "metadata.author",
"destination_field": "author"
},
{
"operation": "remove",
"source_field": "html"
},
{
"operation": "remove_nulls"
}
],
"source": {
"type": "salesforce",
"credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
"schedule": {
"enabled": true,
"time_zone": "America/New_York",
"frequency": "weekly"
},
"options": {
"site_collections": [
{
"site_collection_path": "/sites/TestSiteA",
"limit": 10
}
]
}
}
}
The unique identifier of the configuration.
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The description of the configuration, if available.
Document conversion settings.
- conversions
A list of PDF conversion settings.
- pdf
Object containing heading detection conversion settings for PDF documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- word
Object containing heading detection conversion settings for Microsoft Word documents.
- heading
Array of font matching configurations.
- fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- keep_content
An array to XPaths.
Object containing an array of XPaths.
- exclude_content
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- segment
Enables/disables the Document Segmentation feature.
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- json_normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.
An array of document enrichment settings for the configuration.
- enrichments
Describes what the enrichment step does.
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- options
Object containing Natural Language Understanding features to be used.
- features
An object specifying the Keyword enrichment and related parameters.
- keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- semantic_roles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Possible values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Possible values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- site_collections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Possible values: [
gentle
,normal
,aggressive
]When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
The maximum milliseconds to wait for a response from the web server.
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
A custom configuration for the environment.
{
"configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
"name": "IBM News",
"created": "2015-08-24T18:42:25.324Z",
"updated": "2015-08-24T18:42:25.324Z",
"description": "A configuration useful for ingesting IBM press releases.",
"conversions": {
"html": {
"exclude_tags_keep_content": [
"span"
],
"exclude_content": {
"xpaths": [
"/home"
]
}
},
"segment": {
"enabled": true,
"annotated_fields": [
"custom-field-1",
"custom-field-2"
]
},
"json_normalizations": [
{
"operation": "move",
"source_field": "extracted_metadata.title",
"destination_field": "metadata.title"
},
{
"operation": "move",
"source_field": "extracted_metadata.author",
"destination_field": "metadata.author"
},
{
"operation": "remove",
"source_field": "extracted_metadata"
}
]
},
"enrichments": [
{
"enrichment": "natural_language_understanding",
"source_field": "title",
"destination_field": "enriched_title",
"options": {
"features": {
"keywords": {
"sentiment": true,
"emotion": false,
"limit": 50
},
"entities": {
"sentiment": true,
"emotion": false,
"limit": 50,
"mentions": true,
"mention_types": true,
"sentence_locations": true,
"model": "WKS-model-id"
},
"sentiment": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"emotion": {
"document": true,
"targets": [
"IBM",
"Watson"
]
},
"categories": {},
"concepts": {
"limit": 8
},
"semantic_roles": {
"entities": true,
"keywords": true,
"limit": 50
},
"relations": {
"model": "WKS-model-id"
}
}
}
}
],
"normalizations": [
{
"operation": "move",
"source_field": "metadata.title",
"destination_field": "title"
},
{
"operation": "move",
"source_field": "metadata.author",
"destination_field": "author"
},
{
"operation": "remove",
"source_field": "html"
},
{
"operation": "remove_nulls"
}
],
"source": {
"type": "salesforce",
"credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
"schedule": {
"enabled": true,
"time_zone": "America/New_York",
"frequency": "weekly"
},
"options": {
"site_collections": [
{
"site_collection_path": "/sites/TestSiteA",
"limit": 10
}
]
}
}
}
The unique identifier of the configuration.
The name of the configuration.
Possible values: 0 ≤ length ≤ 255
The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The timestamp of when the configuration was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The description of the configuration, if available.
Document conversion settings.
- Conversions
A list of PDF conversion settings.
- Pdf
Object containing heading detection conversion settings for PDF documents.
- Heading
Array of font matching configurations.
- Fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
A list of Word conversion settings.
- Word
Object containing heading detection conversion settings for Microsoft Word documents.
- Heading
Array of font matching configurations.
- Fonts
The HTML heading level that any content with the matching font is converted to.
The minimum size of the font to match.
The maximum size of the font to match.
When
true
, the font is matched if it is bold.When
true
, the font is matched if it is italic.The name of the font.
Array of Microsoft Word styles to convert.
- Styles
HTML head level that content matching this style is tagged with.
Array of word style names to convert.
A list of HTML conversion settings.
- Html
Array of HTML tags that are excluded completely.
Array of HTML tags which are excluded but still retain content.
Object containing an array of XPaths.
- KeepContent
An array to XPaths.
Object containing an array of XPaths.
- ExcludeContent
An array to XPaths.
An array of HTML tag attributes to keep in the converted document.
Array of HTML tag attributes to exclude.
A list of Document Segmentation settings.
- Segment
Enables/disables the Document Segmentation feature.
Defines the heading level that splits into document segments. Valid values are h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation splits at is used as the title field for that segmented result. Only valid if used with a collection that has enabled set to
false
in the smart_document_understanding object.Defines the annotated smart document understanding fields that the document is split on. The content of the annotated field that the segmentation splits at is used as the title field for that segmented result. For example, if the field
sub-title
is specified, when a document is uploaded each time the smart document understanding conversion encounters a field of typesub-title
the document is split at that point and the content of the field used as the title of the remaining content. This split is performed for all instances of the listed fields in the uploaded document. Only valid if used with a collection that has enabled set totrue
in the smart_document_understanding object.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- JsonNormalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
When
true
, automatic text extraction from images (this includes images embedded in supported document formats, for example PDF, and suppported image formats, for example TIFF) is performed on documents uploaded to the collection. This field is supported on Advanced and higher plans only. Lite plans do not support image text recognition.
An array of document enrichment settings for the configuration.
- Enrichments
Describes what the enrichment step does.
Field where enrichments will be stored. This field must already exist or be at most 1 level deeper than an existing field. For example, if
text
is a top-level field with no sub-fields,text.foo
is a valid destination buttext.foo.bar
is not.Field to be enriched.
Arrays can be specified as the source_field if the enrichment service for this enrichment is set to
natural_language_undstanding
.Indicates that the enrichments will overwrite the destination_field field if it already exists.
Name of the enrichment service to call. The only supported option is
natural_language_understanding
. Theelements
option is deprecated and support ended on 10 July 2020.The options object must contain Natural Language Understanding options.
If true, then most errors generated during the enrichment process will be treated as warnings and will not cause the document to fail processing.
Options that are specific to a particular enrichment.
The
elements
enrichment type is deprecated. Use the Create a project method of the Discovery v2 API to create acontent_intelligence
project type instead.- Options
Object containing Natural Language Understanding features to be used.
- Features
An object specifying the Keyword enrichment and related parameters.
- Keywords
When
true
, sentiment analysis of keywords will be performed on the specified field.When
true
, emotion detection of keywords will be performed on the specified field.The maximum number of keywords to extract for each instance of the specified field.
An object speficying the Entities enrichment and related parameters.
- Entities
When
true
, sentiment analysis of entities will be performed on the specified field.When
true
, emotion detection of entities will be performed on the specified field.The maximum number of entities to extract for each instance of the specified field.
When
true
, the number of mentions of each identified entity is recorded. The default isfalse
.When
true
, the types of mentions for each idetifieid entity is recorded. The default isfalse
.When
true
, a list of sentence locations for each instance of each identified entity is recorded. The default isfalse
.The enrichement model to use with entity extraction. May be a custom model provided by Watson Knowledge Studio, or the default public model
alchemy
.
An object specifying the sentiment extraction enrichment and related parameters.
- Sentiment
When
true
, sentiment analysis is performed on the entire field.A comma-separated list of target strings that will have any associated sentiment analyzed.
An object specifying the emotion detection enrichment and related parameters.
- Emotion
When
true
, emotion detection is performed on the entire field.A comma-separated list of target strings that will have any associated emotions detected.
An object that indicates the Categories enrichment will be applied to the specified field.
An object specifiying the semantic roles enrichment and related parameters.
- SemanticRoles
When
true
, entities are extracted from the identified sentence parts.When
true
, keywords are extracted from the identified sentence parts.The maximum number of semantic roles enrichments to extact from each instance of the specified field.
An object specifying the relations enrichment and related parameters.
- Relations
For use with
natural_language_understanding
enrichments only. The enrichement model to use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, the default public model isen-news
.
An object specifiying the concepts enrichment and related parameters.
- Concepts
The maximum number of concepts enrichments to extact from each instance of the specified field.
ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are
ar
(Arabic),en
(English),fr
(French),de
(German),it
(Italian),pt
(Portuguese),ru
(Russian),es
(Spanish), andsv
(Swedish). Note: Not all features support all languages, automatic detection is recommended.Possible values: [
ar
,en
,fr
,de
,it
,pt
,ru
,es
,sv
]The element extraction model to use, which can be
contract
only. Theelements
enrichment is deprecated.
Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.
- Normalizations
Identifies what type of operation to perform.
copy - Copies the value of the source_field to the destination_field field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field.
move - Renames (moves) the source_field to the destination_field. If the destination_field already exists, then the value of the source_field overwrites the original value of the destination_field. Rename is identical to copy, except that the source_field is removed after the value has been copied to the destination_field (it is the same as a copy followed by a remove).
merge - Merges the value of the source_field with the value of the destination_field. The destination_field is converted into an array if it is not already an array, and the value of the source_field is appended to the array. This operation removes the source_field after the merge. If the source_field does not exist in the current document, then the destination_field is still converted into an array (if it is not an array already). This conversion ensures the type for destination_field is consistent across all documents.
remove - Deletes the source_field field. The destination_field is ignored for this operation.
remove_nulls - Removes all nested null (blank) field values from the ingested document. source_field and destination_field are ignored by this operation because remove_nulls operates on the entire ingested document. Typically, remove_nulls is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive).
Possible values: [
copy
,move
,merge
,remove
,remove_nulls
]The source field for the operation.
The destination field for the operation.
Object containing source parameters for the configuration.
- Source
The type of source to connect to.
box
indicates the configuration is to connect an instance of Enterprise Box.salesforce
indicates the configuration is to connect to Salesforce.sharepoint
indicates the configuration is to connect to Microsoft SharePoint Online.web_crawl
indicates the configuration is to perform a web page crawl.cloud_object_storage
indicates the configuration is to connect to a cloud object store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]The credential_id of the credentials to use to connect to the source. Credentials are defined using the credentials method. The source_type of the credentials used must match the type field specified in this object.
Object containing the schedule information for the source.
- Schedule
When
true
, the source is re-crawled based on the frequency field in this object. Whenfalse
the source is not re-crawled; Whenfalse
and connecting to Salesforce the source is crawled annually.The time zone to base source crawl times on. Possible values correspond to the IANA (Internet Assigned Numbers Authority) time zones list.
The crawl schedule in the specified time_zone.
five_minutes
: Runs every five minutes.hourly
: Runs every hour.daily
: Runs every day between 00:00 and 06:00.weekly
: Runs every week on Sunday between 00:00 and 06:00.monthly
: Runs the on the first Sunday of every month between 00:00 and 06:00.
Possible values: [
daily
,weekly
,monthly
,five_minutes
,hourly
]
The options object defines which items to crawl from the source system.
- Options
Array of folders to crawl from the Box source. Only valid, and required, when the type field of the source object is set to
box
.- Folders
The Box user ID of the user who owns the folder to crawl.
The Box folder ID of the folder to crawl.
The maximum number of documents to crawl for this folder. By default, all documents in the folder are crawled.
Array of Salesforce document object types to crawl from the Salesforce source. Only valid, and required, when the type field of the source object is set to
salesforce
.- Objects
The name of the Salesforce document object to crawl. For example,
case
.The maximum number of documents to crawl for this document object. By default, all documents in the document object are crawled.
Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint source. Only valid and required when the type field of the source object is set to
sharepoint
.- SiteCollections
The Microsoft SharePoint Online site collection path to crawl. The path must be be relative to the organization_url that was specified in the credentials associated with this source configuration.
The maximum number of documents to crawl for this site collection. By default, all documents in the site collection are crawled.
Array of Web page URLs to begin crawling the web from. Only valid and required when the type field of the source object is set to
web_crawl
.- Urls
The starting URL to crawl.
When
true
, crawls of the specified URL are limited to the host part of the url field.The number of concurrent URLs to fetch.
gentle
means one URL is fetched at a time with a delay between each call.normal
means as many as two URLs are fectched concurrently with a short delay between fetch calls.aggressive
means that up to ten URLs are fetched concurrently with a short delay between fetch calls.Possible values: [
gentle
,normal
,aggressive
]When
true
, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers.The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will also be crawled if it is within the maximum_hops from the initial URL. The first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled from those pages is 2 hops, and so on.
The maximum milliseconds to wait for a response from the web server.
When
true
, the crawler will ignore anyrobots.txt
encountered by the crawler. This should only ever be done when crawling a web site the user owns. This must be be set totrue
when a gateway_id is specied in the credentials.Array of URL's to be excluded while crawling. The crawler will not follow links which contains this string. For example, listing
https://ibm.com/watson
also excludeshttps://ibm.com/watson/discovery
.
Array of cloud object store buckets to begin crawling. Only valid and required when the type field of the source object is set to
cloud_object_store
, and the crawl_all_buckets field isfalse
or not specified.- Buckets
The name of the cloud object store bucket to crawl.
The number of documents to crawl from this cloud object store bucket. If not specified, all documents in the bucket are crawled.
When
true
, all buckets in the specified cloud object store are crawled. If set totrue
, the buckets array must not be specified.
Status Code
Configuration successfully updated.
Bad request.
Forbidden. Returned if you attempt to update a read-only configuration or if you attempt to update a configuration in a read-only environment.
{ "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e", "name": "IBM News", "created": "2015-08-24T18:42:25.324Z", "updated": "2015-08-24T18:42:25.324Z", "description": "A configuration useful for ingesting IBM press releases.", "conversions": { "html": { "exclude_tags_keep_content": [ "span" ], "exclude_content": { "xpaths": [ "/home" ] } }, "segment": { "enabled": true, "annotated_fields": [ "custom-field-1", "custom-field-2" ] }, "json_normalizations": [ { "operation": "move", "source_field": "extracted_metadata.title", "destination_field": "metadata.title" }, { "operation": "move", "source_field": "extracted_metadata.author", "destination_field": "metadata.author" }, { "operation": "remove", "source_field": "extracted_metadata" } ] }, "enrichments": [ { "enrichment": "natural_language_understanding", "source_field": "title", "destination_field": "enriched_title", "options": { "features": { "keywords": { "sentiment": true, "emotion": false, "limit": 50 }, "entities": { "sentiment": true, "emotion": false, "limit": 50, "mentions": true, "mention_types": true, "sentence_locations": true, "model": "WKS-model-id" }, "sentiment": { "document": true, "targets": [ "IBM", "Watson" ] }, "emotion": { "document": true, "targets": [ "IBM", "Watson" ] }, "categories": {}, "concepts": { "limit": 8 }, "semantic_roles": { "entities": true, "keywords": true, "limit": 50 }, "relations": { "model": "WKS-model-id" } } } } ], "normalizations": [ { "operation": "move", "source_field": "metadata.title", "destination_field": "title" }, { "operation": "move", "source_field": "metadata.author", "destination_field": "author" }, { "operation": "remove", "source_field": "html" }, { "operation": "remove_nulls" } ], "source": { "type": "salesforce", "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b", "schedule": { "enabled": true, "time_zone": "America/New_York", "frequency": "weekly" }, "options": { "site_collections": [ { "site_collection_path": "/sites/TestSiteA", "limit": 10 } ] } } }
{ "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e", "name": "IBM News", "created": "2015-08-24T18:42:25.324Z", "updated": "2015-08-24T18:42:25.324Z", "description": "A configuration useful for ingesting IBM press releases.", "conversions": { "html": { "exclude_tags_keep_content": [ "span" ], "exclude_content": { "xpaths": [ "/home" ] } }, "segment": { "enabled": true, "annotated_fields": [ "custom-field-1", "custom-field-2" ] }, "json_normalizations": [ { "operation": "move", "source_field": "extracted_metadata.title", "destination_field": "metadata.title" }, { "operation": "move", "source_field": "extracted_metadata.author", "destination_field": "metadata.author" }, { "operation": "remove", "source_field": "extracted_metadata" } ] }, "enrichments": [ { "enrichment": "natural_language_understanding", "source_field": "title", "destination_field": "enriched_title", "options": { "features": { "keywords": { "sentiment": true, "emotion": false, "limit": 50 }, "entities": { "sentiment": true, "emotion": false, "limit": 50, "mentions": true, "mention_types": true, "sentence_locations": true, "model": "WKS-model-id" }, "sentiment": { "document": true, "targets": [ "IBM", "Watson" ] }, "emotion": { "document": true, "targets": [ "IBM", "Watson" ] }, "categories": {}, "concepts": { "limit": 8 }, "semantic_roles": { "entities": true, "keywords": true, "limit": 50 }, "relations": { "model": "WKS-model-id" } } } } ], "normalizations": [ { "operation": "move", "source_field": "metadata.title", "destination_field": "title" }, { "operation": "move", "source_field": "metadata.author", "destination_field": "author" }, { "operation": "remove", "source_field": "html" }, { "operation": "remove_nulls" } ], "source": { "type": "salesforce", "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b", "schedule": { "enabled": true, "time_zone": "America/New_York", "frequency": "weekly" }, "options": { "site_collections": [ { "site_collection_path": "/sites/TestSiteA", "limit": 10 } ] } } }
Delete a configuration
The deletion is performed unconditionally. A configuration deletion request succeeds even if the configuration is referenced by a collection or document ingestion. However, documents that have already been submitted for processing continue to use the deleted configuration. Documents are always processed with a snapshot of the configuration as it existed at the time the document was submitted.
The deletion is performed unconditionally. A configuration deletion request succeeds even if the configuration is referenced by a collection or document ingestion. However, documents that have already been submitted for processing continue to use the deleted configuration. Documents are always processed with a snapshot of the configuration as it existed at the time the document was submitted.
The deletion is performed unconditionally. A configuration deletion request succeeds even if the configuration is referenced by a collection or document ingestion. However, documents that have already been submitted for processing continue to use the deleted configuration. Documents are always processed with a snapshot of the configuration as it existed at the time the document was submitted.
The deletion is performed unconditionally. A configuration deletion request succeeds even if the configuration is referenced by a collection or document ingestion. However, documents that have already been submitted for processing continue to use the deleted configuration. Documents are always processed with a snapshot of the configuration as it existed at the time the document was submitted.
The deletion is performed unconditionally. A configuration deletion request succeeds even if the configuration is referenced by a collection or document ingestion. However, documents that have already been submitted for processing continue to use the deleted configuration. Documents are always processed with a snapshot of the configuration as it existed at the time the document was submitted.
DELETE /v1/environments/{environment_id}/configurations/{configuration_id}
ServiceCall<DeleteConfigurationResponse> deleteConfiguration(DeleteConfigurationOptions deleteConfigurationOptions)
deleteConfiguration(params)
delete_configuration(
self,
environment_id: str,
configuration_id: str,
**kwargs,
) -> DetailedResponse
DeleteConfiguration(string environmentId, string configurationId)
Request
Use the DeleteConfigurationOptions.Builder
to create a DeleteConfigurationOptions
object that contains the parameter values for the deleteConfiguration
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the configuration.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The deleteConfiguration options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the configuration.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the configuration.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the configuration.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the configuration.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -X DELETE -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/configurations/{configuration_id}?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.DeleteConfiguration( environmentId: "{environmentId}", configurationId: "{configurationId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String configurationId = "{configuration_id}"; DeleteConfigurationOptions deleteRequest = new DeleteConfigurationOptions.Builder(environmentId, configurationId).build(); DeleteConfigurationResponse deleteResponse = discovery.deleteConfiguration(deleteRequest).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const deleteConfigurationParams = { environmentId: '{environment_id}', configurationId: '{configuration_id}', }; discovery.deleteConfiguration(deleteConfigurationParams) .then(deleteConfigurationResponse => { console.log(JSON.stringify(deleteConfigurationResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') config_delete = discovery.delete_configuration('{environment_id}', '{configuration_id}').get_result() print(json.dumps(config_delete, indent=2))
Response
Information returned when a configuration is deleted.
The unique identifier for the configuration.
Status of the configuration. A deleted configuration has the status deleted.
Possible values: [
deleted
]An array of notice messages, if any.
Information returned when a configuration is deleted.
{
"configuration_id": "123abc",
"status": "deleted",
"notices": [
{
"notice_id": "configuration_in_use",
"created": "2016-09-28T12:34:00.000Z",
"severity": "warning",
"description": "The configuration was deleted, but it is referenced by one or more collections."
}
]
}
The unique identifier for the configuration.
Status of the configuration. A deleted configuration has the status deleted.
Possible values: [
deleted
]An array of notice messages, if any.
- notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Information returned when a configuration is deleted.
{
"configuration_id": "123abc",
"status": "deleted",
"notices": [
{
"notice_id": "configuration_in_use",
"created": "2016-09-28T12:34:00.000Z",
"severity": "warning",
"description": "The configuration was deleted, but it is referenced by one or more collections."
}
]
}
The unique identifier for the configuration.
Status of the configuration. A deleted configuration has the status deleted.
Possible values: [
deleted
]An array of notice messages, if any.
- notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Information returned when a configuration is deleted.
{
"configuration_id": "123abc",
"status": "deleted",
"notices": [
{
"notice_id": "configuration_in_use",
"created": "2016-09-28T12:34:00.000Z",
"severity": "warning",
"description": "The configuration was deleted, but it is referenced by one or more collections."
}
]
}
The unique identifier for the configuration.
Status of the configuration. A deleted configuration has the status deleted.
Possible values: [
deleted
]An array of notice messages, if any.
- notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Information returned when a configuration is deleted.
{
"configuration_id": "123abc",
"status": "deleted",
"notices": [
{
"notice_id": "configuration_in_use",
"created": "2016-09-28T12:34:00.000Z",
"severity": "warning",
"description": "The configuration was deleted, but it is referenced by one or more collections."
}
]
}
The unique identifier for the configuration.
Status of the configuration. A deleted configuration has the status deleted.
Possible values: [
deleted
]An array of notice messages, if any.
- Notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Status Code
Configuration successfully deleted. The response contains a warning if the configuration was referenced by at least one collection.
Bad request.
A bad request is returned any time there is a problem with the request itself.
Example error messages:
Invalid Configuration ID
- if the configuration ID is not correctly formatted.Invalid configurationId: 2c3a981b-dade-488c-b8c6-01ae8d111111
- if the configuration is not found.
Forbidden. Returned if you attempt to delete a read-only configuration, or if you attempt to delete a configuration from a read-only environment.
{ "configuration_id": "123abc", "status": "deleted", "notices": [ { "notice_id": "configuration_in_use", "created": "2016-09-28T12:34:00.000Z", "severity": "warning", "description": "The configuration was deleted, but it is referenced by one or more collections." } ] }
{ "configuration_id": "123abc", "status": "deleted", "notices": [ { "notice_id": "configuration_in_use", "created": "2016-09-28T12:34:00.000Z", "severity": "warning", "description": "The configuration was deleted, but it is referenced by one or more collections." } ] }
Create a collection
POST /v1/environments/{environment_id}/collections
ServiceCall<Collection> createCollection(CreateCollectionOptions createCollectionOptions)
createCollection(params)
create_collection(
self,
environment_id: str,
name: str,
*,
description: str = None,
configuration_id: str = None,
language: str = None,
**kwargs,
) -> DetailedResponse
CreateCollection(string environmentId, string name, string description = null, string configurationId = null, string language = null)
Request
Use the CreateCollectionOptions.Builder
to create a CreateCollectionOptions
object that contains the parameter values for the createCollection
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
Input an object that allows you to add a collection.
The name of the collection to be created.
Possible values: 0 ≤ length ≤ 255
A description of the collection.
Default:
The ID of the configuration in which the collection is to be created.
Default:
The language of the documents stored in the collection, in the form of an ISO 639-1 language code.
Allowable values: [
en
,es
,de
,ar
,fr
,it
,ja
,ko
,pt
,nl
,zh-CN
]Default:
en
The createCollection options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The name of the collection to be created.
Possible values: 0 ≤ length ≤ 255
A description of the collection.
Default:
The ID of the configuration in which the collection is to be created.
Default:
The language of the documents stored in the collection, in the form of an ISO 639-1 language code.
Allowable values: [
en
,es
,de
,ar
,fr
,it
,ja
,ko
,pt
,nl
,zh-CN
]Default:
en
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The name of the collection to be created.
Possible values: 0 ≤ length ≤ 255
A description of the collection.
Default:
The ID of the configuration in which the collection is to be created.
Default:
The language of the documents stored in the collection, in the form of an ISO 639-1 language code.
Allowable values: [
en
,es
,de
,ar
,fr
,it
,ja
,ko
,pt
,nl
,zh-CN
]Default:
en
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The name of the collection to be created.
Possible values: 0 ≤ length ≤ 255
A description of the collection.
Default:
The ID of the configuration in which the collection is to be created.
Default:
The language of the documents stored in the collection, in the form of an ISO 639-1 language code.
Allowable values: [
en
,es
,de
,ar
,fr
,it
,ja
,ko
,pt
,nl
,zh-CN
]Default:
en
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The name of the collection to be created.
Possible values: 0 ≤ length ≤ 255
A description of the collection.
Default:
The ID of the configuration in which the collection is to be created.
Default:
The language of the documents stored in the collection, in the form of an ISO 639-1 language code.
Allowable values: [
en
,es
,de
,ar
,fr
,it
,ja
,ko
,pt
,nl
,zh-CN
]Default:
en
curl -X POST -u "apikey":"{apikey}" -H "Content-Type: application/json" -d '{ "name": "test_collection", "description": "My test collection", "configuration_id": "{configuration_id}", "language": "en" }' "{url}/v1/environments/{environment_id}/collections?version=2019-04-30"
{ "name": "{collection_name}", "description": "{description}", "configuration_id": "{configuration_id}", "language": "en" }
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.CreateCollection( environmentId: "{environmentId}", configurationId: "{configurationId}", name: "{collectionName}", language: "{language}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String configurationId = "{configuration_id}"; String collectionName = "{collection_name}"; String languageCode = "{language}"; CreateCollectionOptions.Builder createCollectionBuilder = new CreateCollectionOptions.Builder(environmentId, configurationId, collectionName, languageCode); Collection createResponse = discovery.createCollection(createCollectionBuilder.build()).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const createCollectionParams = { environmentId: '{environment_id}', name: 'node-examples-test', language: 'ja', }; discovery.createCollection(createCollectionParams) .then(collection => { console.log(JSON.stringify(collection, null, 2)); }) .catch(err => { console.log('error:', err); });
import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') new_collection = discovery.create_collection( environment_id='{environment_id}', configuration_id='{configuration_id}', name='{collection_name}', description='{collection_desc}', language='{collection_lang}').get_result() print(json.dumps(new_collection, indent=2))
Response
A collection for storing documents.
The unique identifier of the collection.
The name of the collection.
Possible values: 0 ≤ length ≤ 255
The description of the collection.
The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'
The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
The status of the collection.
Possible values: [
active
,pending
,maintenance
]The unique identifier of the collection's configuration.
The language of the documents stored in the collection. Permitted values include
en
(English),de
(German), andes
(Spanish).Object containing collection document count information.
Summary of the disk usage statistics for this collection.
Training status details.
Object containing information about the crawl status of this collection.
- crawl_status
Object containing source crawl status information.
Object containing smart document understanding information for this collection.
A collection for storing documents.
{
"collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
"name": "test-collection",
"configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
"language": "de",
"status": "active",
"description": "A test collection to show as an example",
"created": "2017-07-14T12:55:40.652Z",
"updated": "2017-07-14T12:55:40.652Z",
"document_counts": {
"available": 0,
"processing": 0,
"failed": 0
},
"disk_usage": {
"used_bytes": 260
},
"training_status": {
"data_updated": "",
"total_examples": 0,
"sufficient_label_diversity": false,
"processing": false,
"minimum_examples_added": false,
"successfully_trained": "",
"available": false,
"notices": 0,
"minimum_queries_added": false
},
"crawl_status": {
"source_crawl": {
"status": "complete",
"last_updated": "2018-01-05T12:55:40.652Z"
}
},
"smart_document_understanding": {
"enabled": true,
"total_annotated_pages": 0,
"total_pages": 0,
"total_documents": 0,
"custom_fields": {
"maximum_allowed": 5
}
}
}
The unique identifier of the collection.
The name of the collection.
Possible values: 0 ≤ length ≤ 255
The description of the collection.
The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'.
The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The status of the collection.
Possible values: [
active
,pending
,maintenance
]The unique identifier of the collection's configuration.
The language of the documents stored in the collection. Permitted values include
en
(English),de
(German), andes
(Spanish).Object containing collection document count information.
- documentCounts
The total number of available documents in the collection.
The number of documents in the collection that are currently being processed.
The number of documents in the collection that failed to be ingested.
The number of documents that have been uploaded to the collection, but have not yet started processing.
Summary of the disk usage statistics for this collection.
- diskUsage
Number of bytes used by the collection.
Training status details.
- trainingStatus
The total number of training examples uploaded to this collection.
When
true
, the collection has been successfully trained.When
true
, the collection is currently processing training.When
true
, the collection has a sufficent amount of queries added for training to occur.When
true
, the collection has a sufficent amount of examples added for training to occur.When
true
, the collection has a sufficent amount of diversity in labeled results for training to occur.The number of notices associated with this data set.
The timestamp of when the collection was successfully trained.
The timestamp of when the data was uploaded.
Object containing information about the crawl status of this collection.
- crawlStatus
Object containing source crawl status information.
- sourceCrawl
The current status of the source crawl for this collection. This field returns
not_configured
if the default configuration for this source does not have a source object defined.running
indicates that a crawl to fetch more documents is in progress.complete
indicates that the crawl has completed with no errors.queued
indicates that the crawl has been paused by the system and will automatically restart when possible.unknown
indicates that an unidentified error has occured in the service.
Possible values: [
running
,complete
,not_configured
,queued
,unknown
]Date in
RFC 3339
format indicating the time of the next crawl attempt.
Object containing smart document understanding information for this collection.
- smartDocumentUnderstanding
When
true
, smart document understanding conversion is enabled for this collection. All collections created with a version date after2019-04-30
have smart document understanding enabled. Iffalse
, documents added to the collection are converted using the conversion settings specified in the configuration associated with the collection.The total number of pages annotated using smart document understanding in this collection.
The current number of pages that can be used for training smart document understanding. The
total_pages
number is calculated as the total number of pages identified from the documents listed in the total_documents field.The total number of documents in this collection that can be used to train smart document understanding. For lite plan collections, the maximum is the first 20 uploaded documents (not including HTML or JSON documents). For other plans, the maximum is the first 40 uploaded documents (not including HTML or JSON documents). When the maximum is reached, additional documents uploaded to the collection are not considered for training smart document understanding.
Information about custom smart document understanding fields that exist in this collection.
- customFields
The number of custom fields defined for this collection.
The maximum number of custom fields that are allowed in this collection.
A collection for storing documents.
{
"collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
"name": "test-collection",
"configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
"language": "de",
"status": "active",
"description": "A test collection to show as an example",
"created": "2017-07-14T12:55:40.652Z",
"updated": "2017-07-14T12:55:40.652Z",
"document_counts": {
"available": 0,
"processing": 0,
"failed": 0
},
"disk_usage": {
"used_bytes": 260
},
"training_status": {
"data_updated": "",
"total_examples": 0,
"sufficient_label_diversity": false,
"processing": false,
"minimum_examples_added": false,
"successfully_trained": "",
"available": false,
"notices": 0,
"minimum_queries_added": false
},
"crawl_status": {
"source_crawl": {
"status": "complete",
"last_updated": "2018-01-05T12:55:40.652Z"
}
},
"smart_document_understanding": {
"enabled": true,
"total_annotated_pages": 0,
"total_pages": 0,
"total_documents": 0,
"custom_fields": {
"maximum_allowed": 5
}
}
}
The unique identifier of the collection.
The name of the collection.
Possible values: 0 ≤ length ≤ 255
The description of the collection.
The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'.
The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The status of the collection.
Possible values: [
active
,pending
,maintenance
]The unique identifier of the collection's configuration.
The language of the documents stored in the collection. Permitted values include
en
(English),de
(German), andes
(Spanish).Object containing collection document count information.
- document_counts
The total number of available documents in the collection.
The number of documents in the collection that are currently being processed.
The number of documents in the collection that failed to be ingested.
The number of documents that have been uploaded to the collection, but have not yet started processing.
Summary of the disk usage statistics for this collection.
- disk_usage
Number of bytes used by the collection.
Training status details.
- training_status
The total number of training examples uploaded to this collection.
When
true
, the collection has been successfully trained.When
true
, the collection is currently processing training.When
true
, the collection has a sufficent amount of queries added for training to occur.When
true
, the collection has a sufficent amount of examples added for training to occur.When
true
, the collection has a sufficent amount of diversity in labeled results for training to occur.The number of notices associated with this data set.
The timestamp of when the collection was successfully trained.
The timestamp of when the data was uploaded.
Object containing information about the crawl status of this collection.
- crawl_status
Object containing source crawl status information.
- source_crawl
The current status of the source crawl for this collection. This field returns
not_configured
if the default configuration for this source does not have a source object defined.running
indicates that a crawl to fetch more documents is in progress.complete
indicates that the crawl has completed with no errors.queued
indicates that the crawl has been paused by the system and will automatically restart when possible.unknown
indicates that an unidentified error has occured in the service.
Possible values: [
running
,complete
,not_configured
,queued
,unknown
]Date in
RFC 3339
format indicating the time of the next crawl attempt.
Object containing smart document understanding information for this collection.
- smart_document_understanding
When
true
, smart document understanding conversion is enabled for this collection. All collections created with a version date after2019-04-30
have smart document understanding enabled. Iffalse
, documents added to the collection are converted using the conversion settings specified in the configuration associated with the collection.The total number of pages annotated using smart document understanding in this collection.
The current number of pages that can be used for training smart document understanding. The
total_pages
number is calculated as the total number of pages identified from the documents listed in the total_documents field.The total number of documents in this collection that can be used to train smart document understanding. For lite plan collections, the maximum is the first 20 uploaded documents (not including HTML or JSON documents). For other plans, the maximum is the first 40 uploaded documents (not including HTML or JSON documents). When the maximum is reached, additional documents uploaded to the collection are not considered for training smart document understanding.
Information about custom smart document understanding fields that exist in this collection.
- custom_fields
The number of custom fields defined for this collection.
The maximum number of custom fields that are allowed in this collection.
A collection for storing documents.
{
"collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
"name": "test-collection",
"configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
"language": "de",
"status": "active",
"description": "A test collection to show as an example",
"created": "2017-07-14T12:55:40.652Z",
"updated": "2017-07-14T12:55:40.652Z",
"document_counts": {
"available": 0,
"processing": 0,
"failed": 0
},
"disk_usage": {
"used_bytes": 260
},
"training_status": {
"data_updated": "",
"total_examples": 0,
"sufficient_label_diversity": false,
"processing": false,
"minimum_examples_added": false,
"successfully_trained": "",
"available": false,
"notices": 0,
"minimum_queries_added": false
},
"crawl_status": {
"source_crawl": {
"status": "complete",
"last_updated": "2018-01-05T12:55:40.652Z"
}
},
"smart_document_understanding": {
"enabled": true,
"total_annotated_pages": 0,
"total_pages": 0,
"total_documents": 0,
"custom_fields": {
"maximum_allowed": 5
}
}
}
The unique identifier of the collection.
The name of the collection.
Possible values: 0 ≤ length ≤ 255
The description of the collection.
The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'.
The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The status of the collection.
Possible values: [
active
,pending
,maintenance
]The unique identifier of the collection's configuration.
The language of the documents stored in the collection. Permitted values include
en
(English),de
(German), andes
(Spanish).Object containing collection document count information.
- document_counts
The total number of available documents in the collection.
The number of documents in the collection that are currently being processed.
The number of documents in the collection that failed to be ingested.
The number of documents that have been uploaded to the collection, but have not yet started processing.
Summary of the disk usage statistics for this collection.
- disk_usage
Number of bytes used by the collection.
Training status details.
- training_status
The total number of training examples uploaded to this collection.
When
true
, the collection has been successfully trained.When
true
, the collection is currently processing training.When
true
, the collection has a sufficent amount of queries added for training to occur.When
true
, the collection has a sufficent amount of examples added for training to occur.When
true
, the collection has a sufficent amount of diversity in labeled results for training to occur.The number of notices associated with this data set.
The timestamp of when the collection was successfully trained.
The timestamp of when the data was uploaded.
Object containing information about the crawl status of this collection.
- crawl_status
Object containing source crawl status information.
- source_crawl
The current status of the source crawl for this collection. This field returns
not_configured
if the default configuration for this source does not have a source object defined.running
indicates that a crawl to fetch more documents is in progress.complete
indicates that the crawl has completed with no errors.queued
indicates that the crawl has been paused by the system and will automatically restart when possible.unknown
indicates that an unidentified error has occured in the service.
Possible values: [
running
,complete
,not_configured
,queued
,unknown
]Date in
RFC 3339
format indicating the time of the next crawl attempt.
Object containing smart document understanding information for this collection.
- smart_document_understanding
When
true
, smart document understanding conversion is enabled for this collection. All collections created with a version date after2019-04-30
have smart document understanding enabled. Iffalse
, documents added to the collection are converted using the conversion settings specified in the configuration associated with the collection.The total number of pages annotated using smart document understanding in this collection.
The current number of pages that can be used for training smart document understanding. The
total_pages
number is calculated as the total number of pages identified from the documents listed in the total_documents field.The total number of documents in this collection that can be used to train smart document understanding. For lite plan collections, the maximum is the first 20 uploaded documents (not including HTML or JSON documents). For other plans, the maximum is the first 40 uploaded documents (not including HTML or JSON documents). When the maximum is reached, additional documents uploaded to the collection are not considered for training smart document understanding.
Information about custom smart document understanding fields that exist in this collection.
- custom_fields
The number of custom fields defined for this collection.
The maximum number of custom fields that are allowed in this collection.
A collection for storing documents.
{
"collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
"name": "test-collection",
"configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
"language": "de",
"status": "active",
"description": "A test collection to show as an example",
"created": "2017-07-14T12:55:40.652Z",
"updated": "2017-07-14T12:55:40.652Z",
"document_counts": {
"available": 0,
"processing": 0,
"failed": 0
},
"disk_usage": {
"used_bytes": 260
},
"training_status": {
"data_updated": "",
"total_examples": 0,
"sufficient_label_diversity": false,
"processing": false,
"minimum_examples_added": false,
"successfully_trained": "",
"available": false,
"notices": 0,
"minimum_queries_added": false
},
"crawl_status": {
"source_crawl": {
"status": "complete",
"last_updated": "2018-01-05T12:55:40.652Z"
}
},
"smart_document_understanding": {
"enabled": true,
"total_annotated_pages": 0,
"total_pages": 0,
"total_documents": 0,
"custom_fields": {
"maximum_allowed": 5
}
}
}
The unique identifier of the collection.
The name of the collection.
Possible values: 0 ≤ length ≤ 255
The description of the collection.
The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'.
The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The status of the collection.
Possible values: [
active
,pending
,maintenance
]The unique identifier of the collection's configuration.
The language of the documents stored in the collection. Permitted values include
en
(English),de
(German), andes
(Spanish).Object containing collection document count information.
- DocumentCounts
The total number of available documents in the collection.
The number of documents in the collection that are currently being processed.
The number of documents in the collection that failed to be ingested.
The number of documents that have been uploaded to the collection, but have not yet started processing.
Summary of the disk usage statistics for this collection.
- DiskUsage
Number of bytes used by the collection.
Training status details.
- TrainingStatus
The total number of training examples uploaded to this collection.
When
true
, the collection has been successfully trained.When
true
, the collection is currently processing training.When
true
, the collection has a sufficent amount of queries added for training to occur.When
true
, the collection has a sufficent amount of examples added for training to occur.When
true
, the collection has a sufficent amount of diversity in labeled results for training to occur.The number of notices associated with this data set.
The timestamp of when the collection was successfully trained.
The timestamp of when the data was uploaded.
Object containing information about the crawl status of this collection.
- CrawlStatus
Object containing source crawl status information.
- SourceCrawl
The current status of the source crawl for this collection. This field returns
not_configured
if the default configuration for this source does not have a source object defined.running
indicates that a crawl to fetch more documents is in progress.complete
indicates that the crawl has completed with no errors.queued
indicates that the crawl has been paused by the system and will automatically restart when possible.unknown
indicates that an unidentified error has occured in the service.
Possible values: [
running
,complete
,not_configured
,queued
,unknown
]Date in
RFC 3339
format indicating the time of the next crawl attempt.
Object containing smart document understanding information for this collection.
- SmartDocumentUnderstanding
When
true
, smart document understanding conversion is enabled for this collection. All collections created with a version date after2019-04-30
have smart document understanding enabled. Iffalse
, documents added to the collection are converted using the conversion settings specified in the configuration associated with the collection.The total number of pages annotated using smart document understanding in this collection.
The current number of pages that can be used for training smart document understanding. The
total_pages
number is calculated as the total number of pages identified from the documents listed in the total_documents field.The total number of documents in this collection that can be used to train smart document understanding. For lite plan collections, the maximum is the first 20 uploaded documents (not including HTML or JSON documents). For other plans, the maximum is the first 40 uploaded documents (not including HTML or JSON documents). When the maximum is reached, additional documents uploaded to the collection are not considered for training smart document understanding.
Information about custom smart document understanding fields that exist in this collection.
- CustomFields
The number of custom fields defined for this collection.
The maximum number of custom fields that are allowed in this collection.
Status Code
Collection successfully created.
Bad request if the collection body does not match the expected format or if the configuration_id references a configuration that does not exist. The error string will describe why the request was rejected.
Forbidden. Returned if you attempt to add a collection to a read-only environment.
{ "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96", "name": "test-collection", "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3", "language": "de", "status": "active", "description": "A test collection to show as an example", "created": "2017-07-14T12:55:40.652Z", "updated": "2017-07-14T12:55:40.652Z", "document_counts": { "available": 0, "processing": 0, "failed": 0 }, "disk_usage": { "used_bytes": 260 }, "training_status": { "data_updated": "", "total_examples": 0, "sufficient_label_diversity": false, "processing": false, "minimum_examples_added": false, "successfully_trained": "", "available": false, "notices": 0, "minimum_queries_added": false }, "crawl_status": { "source_crawl": { "status": "complete", "last_updated": "2018-01-05T12:55:40.652Z" } }, "smart_document_understanding": { "enabled": true, "total_annotated_pages": 0, "total_pages": 0, "total_documents": 0, "custom_fields": { "maximum_allowed": 5 } } }
{ "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96", "name": "test-collection", "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3", "language": "de", "status": "active", "description": "A test collection to show as an example", "created": "2017-07-14T12:55:40.652Z", "updated": "2017-07-14T12:55:40.652Z", "document_counts": { "available": 0, "processing": 0, "failed": 0 }, "disk_usage": { "used_bytes": 260 }, "training_status": { "data_updated": "", "total_examples": 0, "sufficient_label_diversity": false, "processing": false, "minimum_examples_added": false, "successfully_trained": "", "available": false, "notices": 0, "minimum_queries_added": false }, "crawl_status": { "source_crawl": { "status": "complete", "last_updated": "2018-01-05T12:55:40.652Z" } }, "smart_document_understanding": { "enabled": true, "total_annotated_pages": 0, "total_pages": 0, "total_documents": 0, "custom_fields": { "maximum_allowed": 5 } } }
List collections
Lists existing collections for the service instance.
Lists existing collections for the service instance.
Lists existing collections for the service instance.
Lists existing collections for the service instance.
Lists existing collections for the service instance.
GET /v1/environments/{environment_id}/collections
ServiceCall<ListCollectionsResponse> listCollections(ListCollectionsOptions listCollectionsOptions)
listCollections(params)
list_collections(
self,
environment_id: str,
*,
name: str = None,
**kwargs,
) -> DetailedResponse
ListCollections(string environmentId, string name = null)
Request
Use the ListCollectionsOptions.Builder
to create a ListCollectionsOptions
object that contains the parameter values for the listCollections
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.Find collections with the given name.
The listCollections options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
Find collections with the given name.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
Find collections with the given name.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
Find collections with the given name.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
Find collections with the given name.
curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.ListCollections( environmentId: "{environmentId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; ListCollectionsOptions listOptions = new ListCollectionsOptions.Builder(environmentId).build(); ListCollectionsResponse listResponse = discovery.listCollections(listOptions).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const listCollectionsParams = { environmentId: '{environment_id}', }; discovery.listCollections(listCollectionsParams) .then(listCollectionsResponse => { console.log(JSON.stringify(listCollectionsResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') collections = discovery.list_collections('{environment_id}').get_result() print(json.dumps(collections, indent=2))
Response
Response object containing an array of collection details.
An array containing information about each collection in the environment.
Response object containing an array of collection details.
{
"collections": [
{
"collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"name": "example",
"description": "this is a demo collection",
"created": "2015-08-24T18:42:25.324Z",
"updated": "2015-08-24T18:42:25.324Z",
"status": "active",
"configuration_id": "6963be41-2dea-4f79-8f52-127c63c479b0",
"language": "en"
}
]
}
An array containing information about each collection in the environment.
Examples:{ "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96", "name": "test-collection", "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3", "language": "de", "status": "active", "description": "A test collection to show as an example", "created": "2017-07-14T12:55:40.652Z", "updated": "2017-07-14T12:55:40.652Z", "document_counts": { "available": 0, "processing": 0, "failed": 0 }, "disk_usage": { "used_bytes": 260 }, "training_status": { "data_updated": "", "total_examples": 0, "sufficient_label_diversity": false, "processing": false, "minimum_examples_added": false, "successfully_trained": "", "available": false, "notices": 0, "minimum_queries_added": false }, "crawl_status": { "source_crawl": { "status": "complete", "last_updated": "2018-01-05T12:55:40.652Z" } }, "smart_document_understanding": { "enabled": true, "total_annotated_pages": 0, "total_pages": 0, "total_documents": 0, "custom_fields": { "maximum_allowed": 5 } } }
- collections
The unique identifier of the collection.
The name of the collection.
Possible values: 0 ≤ length ≤ 255
The description of the collection.
The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'.
The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The status of the collection.
Possible values: [
active
,pending
,maintenance
]The unique identifier of the collection's configuration.
The language of the documents stored in the collection. Permitted values include
en
(English),de
(German), andes
(Spanish).Object containing collection document count information.
- documentCounts
The total number of available documents in the collection.
The number of documents in the collection that are currently being processed.
The number of documents in the collection that failed to be ingested.
The number of documents that have been uploaded to the collection, but have not yet started processing.
Summary of the disk usage statistics for this collection.
- diskUsage
Number of bytes used by the collection.
Training status details.
- trainingStatus
The total number of training examples uploaded to this collection.
When
true
, the collection has been successfully trained.When
true
, the collection is currently processing training.When
true
, the collection has a sufficent amount of queries added for training to occur.When
true
, the collection has a sufficent amount of examples added for training to occur.When
true
, the collection has a sufficent amount of diversity in labeled results for training to occur.The number of notices associated with this data set.
The timestamp of when the collection was successfully trained.
The timestamp of when the data was uploaded.
Object containing information about the crawl status of this collection.
- crawlStatus
Object containing source crawl status information.
- sourceCrawl
The current status of the source crawl for this collection. This field returns
not_configured
if the default configuration for this source does not have a source object defined.running
indicates that a crawl to fetch more documents is in progress.complete
indicates that the crawl has completed with no errors.queued
indicates that the crawl has been paused by the system and will automatically restart when possible.unknown
indicates that an unidentified error has occured in the service.
Possible values: [
running
,complete
,not_configured
,queued
,unknown
]Date in
RFC 3339
format indicating the time of the next crawl attempt.
Object containing smart document understanding information for this collection.
- smartDocumentUnderstanding
When
true
, smart document understanding conversion is enabled for this collection. All collections created with a version date after2019-04-30
have smart document understanding enabled. Iffalse
, documents added to the collection are converted using the conversion settings specified in the configuration associated with the collection.The total number of pages annotated using smart document understanding in this collection.
The current number of pages that can be used for training smart document understanding. The
total_pages
number is calculated as the total number of pages identified from the documents listed in the total_documents field.The total number of documents in this collection that can be used to train smart document understanding. For lite plan collections, the maximum is the first 20 uploaded documents (not including HTML or JSON documents). For other plans, the maximum is the first 40 uploaded documents (not including HTML or JSON documents). When the maximum is reached, additional documents uploaded to the collection are not considered for training smart document understanding.
Information about custom smart document understanding fields that exist in this collection.
- customFields
The number of custom fields defined for this collection.
The maximum number of custom fields that are allowed in this collection.
Response object containing an array of collection details.
{
"collections": [
{
"collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"name": "example",
"description": "this is a demo collection",
"created": "2015-08-24T18:42:25.324Z",
"updated": "2015-08-24T18:42:25.324Z",
"status": "active",
"configuration_id": "6963be41-2dea-4f79-8f52-127c63c479b0",
"language": "en"
}
]
}
An array containing information about each collection in the environment.
Examples:{ "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96", "name": "test-collection", "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3", "language": "de", "status": "active", "description": "A test collection to show as an example", "created": "2017-07-14T12:55:40.652Z", "updated": "2017-07-14T12:55:40.652Z", "document_counts": { "available": 0, "processing": 0, "failed": 0 }, "disk_usage": { "used_bytes": 260 }, "training_status": { "data_updated": "", "total_examples": 0, "sufficient_label_diversity": false, "processing": false, "minimum_examples_added": false, "successfully_trained": "", "available": false, "notices": 0, "minimum_queries_added": false }, "crawl_status": { "source_crawl": { "status": "complete", "last_updated": "2018-01-05T12:55:40.652Z" } }, "smart_document_understanding": { "enabled": true, "total_annotated_pages": 0, "total_pages": 0, "total_documents": 0, "custom_fields": { "maximum_allowed": 5 } } }
- collections
The unique identifier of the collection.
The name of the collection.
Possible values: 0 ≤ length ≤ 255
The description of the collection.
The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'.
The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The status of the collection.
Possible values: [
active
,pending
,maintenance
]The unique identifier of the collection's configuration.
The language of the documents stored in the collection. Permitted values include
en
(English),de
(German), andes
(Spanish).Object containing collection document count information.
- document_counts
The total number of available documents in the collection.
The number of documents in the collection that are currently being processed.
The number of documents in the collection that failed to be ingested.
The number of documents that have been uploaded to the collection, but have not yet started processing.
Summary of the disk usage statistics for this collection.
- disk_usage
Number of bytes used by the collection.
Training status details.
- training_status
The total number of training examples uploaded to this collection.
When
true
, the collection has been successfully trained.When
true
, the collection is currently processing training.When
true
, the collection has a sufficent amount of queries added for training to occur.When
true
, the collection has a sufficent amount of examples added for training to occur.When
true
, the collection has a sufficent amount of diversity in labeled results for training to occur.The number of notices associated with this data set.
The timestamp of when the collection was successfully trained.
The timestamp of when the data was uploaded.
Object containing information about the crawl status of this collection.
- crawl_status
Object containing source crawl status information.
- source_crawl
The current status of the source crawl for this collection. This field returns
not_configured
if the default configuration for this source does not have a source object defined.running
indicates that a crawl to fetch more documents is in progress.complete
indicates that the crawl has completed with no errors.queued
indicates that the crawl has been paused by the system and will automatically restart when possible.unknown
indicates that an unidentified error has occured in the service.
Possible values: [
running
,complete
,not_configured
,queued
,unknown
]Date in
RFC 3339
format indicating the time of the next crawl attempt.
Object containing smart document understanding information for this collection.
- smart_document_understanding
When
true
, smart document understanding conversion is enabled for this collection. All collections created with a version date after2019-04-30
have smart document understanding enabled. Iffalse
, documents added to the collection are converted using the conversion settings specified in the configuration associated with the collection.The total number of pages annotated using smart document understanding in this collection.
The current number of pages that can be used for training smart document understanding. The
total_pages
number is calculated as the total number of pages identified from the documents listed in the total_documents field.The total number of documents in this collection that can be used to train smart document understanding. For lite plan collections, the maximum is the first 20 uploaded documents (not including HTML or JSON documents). For other plans, the maximum is the first 40 uploaded documents (not including HTML or JSON documents). When the maximum is reached, additional documents uploaded to the collection are not considered for training smart document understanding.
Information about custom smart document understanding fields that exist in this collection.
- custom_fields
The number of custom fields defined for this collection.
The maximum number of custom fields that are allowed in this collection.
Response object containing an array of collection details.
{
"collections": [
{
"collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"name": "example",
"description": "this is a demo collection",
"created": "2015-08-24T18:42:25.324Z",
"updated": "2015-08-24T18:42:25.324Z",
"status": "active",
"configuration_id": "6963be41-2dea-4f79-8f52-127c63c479b0",
"language": "en"
}
]
}
An array containing information about each collection in the environment.
Examples:{ "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96", "name": "test-collection", "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3", "language": "de", "status": "active", "description": "A test collection to show as an example", "created": "2017-07-14T12:55:40.652Z", "updated": "2017-07-14T12:55:40.652Z", "document_counts": { "available": 0, "processing": 0, "failed": 0 }, "disk_usage": { "used_bytes": 260 }, "training_status": { "data_updated": "", "total_examples": 0, "sufficient_label_diversity": false, "processing": false, "minimum_examples_added": false, "successfully_trained": "", "available": false, "notices": 0, "minimum_queries_added": false }, "crawl_status": { "source_crawl": { "status": "complete", "last_updated": "2018-01-05T12:55:40.652Z" } }, "smart_document_understanding": { "enabled": true, "total_annotated_pages": 0, "total_pages": 0, "total_documents": 0, "custom_fields": { "maximum_allowed": 5 } } }
- collections
The unique identifier of the collection.
The name of the collection.
Possible values: 0 ≤ length ≤ 255
The description of the collection.
The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'.
The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The status of the collection.
Possible values: [
active
,pending
,maintenance
]The unique identifier of the collection's configuration.
The language of the documents stored in the collection. Permitted values include
en
(English),de
(German), andes
(Spanish).Object containing collection document count information.
- document_counts
The total number of available documents in the collection.
The number of documents in the collection that are currently being processed.
The number of documents in the collection that failed to be ingested.
The number of documents that have been uploaded to the collection, but have not yet started processing.
Summary of the disk usage statistics for this collection.
- disk_usage
Number of bytes used by the collection.
Training status details.
- training_status
The total number of training examples uploaded to this collection.
When
true
, the collection has been successfully trained.When
true
, the collection is currently processing training.When
true
, the collection has a sufficent amount of queries added for training to occur.When
true
, the collection has a sufficent amount of examples added for training to occur.When
true
, the collection has a sufficent amount of diversity in labeled results for training to occur.The number of notices associated with this data set.
The timestamp of when the collection was successfully trained.
The timestamp of when the data was uploaded.
Object containing information about the crawl status of this collection.
- crawl_status
Object containing source crawl status information.
- source_crawl
The current status of the source crawl for this collection. This field returns
not_configured
if the default configuration for this source does not have a source object defined.running
indicates that a crawl to fetch more documents is in progress.complete
indicates that the crawl has completed with no errors.queued
indicates that the crawl has been paused by the system and will automatically restart when possible.unknown
indicates that an unidentified error has occured in the service.
Possible values: [
running
,complete
,not_configured
,queued
,unknown
]Date in
RFC 3339
format indicating the time of the next crawl attempt.
Object containing smart document understanding information for this collection.
- smart_document_understanding
When
true
, smart document understanding conversion is enabled for this collection. All collections created with a version date after2019-04-30
have smart document understanding enabled. Iffalse
, documents added to the collection are converted using the conversion settings specified in the configuration associated with the collection.The total number of pages annotated using smart document understanding in this collection.
The current number of pages that can be used for training smart document understanding. The
total_pages
number is calculated as the total number of pages identified from the documents listed in the total_documents field.The total number of documents in this collection that can be used to train smart document understanding. For lite plan collections, the maximum is the first 20 uploaded documents (not including HTML or JSON documents). For other plans, the maximum is the first 40 uploaded documents (not including HTML or JSON documents). When the maximum is reached, additional documents uploaded to the collection are not considered for training smart document understanding.
Information about custom smart document understanding fields that exist in this collection.
- custom_fields
The number of custom fields defined for this collection.
The maximum number of custom fields that are allowed in this collection.
Response object containing an array of collection details.
{
"collections": [
{
"collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"name": "example",
"description": "this is a demo collection",
"created": "2015-08-24T18:42:25.324Z",
"updated": "2015-08-24T18:42:25.324Z",
"status": "active",
"configuration_id": "6963be41-2dea-4f79-8f52-127c63c479b0",
"language": "en"
}
]
}
An array containing information about each collection in the environment.
Examples:{ "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96", "name": "test-collection", "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3", "language": "de", "status": "active", "description": "A test collection to show as an example", "created": "2017-07-14T12:55:40.652Z", "updated": "2017-07-14T12:55:40.652Z", "document_counts": { "available": 0, "processing": 0, "failed": 0 }, "disk_usage": { "used_bytes": 260 }, "training_status": { "data_updated": "", "total_examples": 0, "sufficient_label_diversity": false, "processing": false, "minimum_examples_added": false, "successfully_trained": "", "available": false, "notices": 0, "minimum_queries_added": false }, "crawl_status": { "source_crawl": { "status": "complete", "last_updated": "2018-01-05T12:55:40.652Z" } }, "smart_document_understanding": { "enabled": true, "total_annotated_pages": 0, "total_pages": 0, "total_documents": 0, "custom_fields": { "maximum_allowed": 5 } } }
- Collections
The unique identifier of the collection.
The name of the collection.
Possible values: 0 ≤ length ≤ 255
The description of the collection.
The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'.
The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The status of the collection.
Possible values: [
active
,pending
,maintenance
]The unique identifier of the collection's configuration.
The language of the documents stored in the collection. Permitted values include
en
(English),de
(German), andes
(Spanish).Object containing collection document count information.
- DocumentCounts
The total number of available documents in the collection.
The number of documents in the collection that are currently being processed.
The number of documents in the collection that failed to be ingested.
The number of documents that have been uploaded to the collection, but have not yet started processing.
Summary of the disk usage statistics for this collection.
- DiskUsage
Number of bytes used by the collection.
Training status details.
- TrainingStatus
The total number of training examples uploaded to this collection.
When
true
, the collection has been successfully trained.When
true
, the collection is currently processing training.When
true
, the collection has a sufficent amount of queries added for training to occur.When
true
, the collection has a sufficent amount of examples added for training to occur.When
true
, the collection has a sufficent amount of diversity in labeled results for training to occur.The number of notices associated with this data set.
The timestamp of when the collection was successfully trained.
The timestamp of when the data was uploaded.
Object containing information about the crawl status of this collection.
- CrawlStatus
Object containing source crawl status information.
- SourceCrawl
The current status of the source crawl for this collection. This field returns
not_configured
if the default configuration for this source does not have a source object defined.running
indicates that a crawl to fetch more documents is in progress.complete
indicates that the crawl has completed with no errors.queued
indicates that the crawl has been paused by the system and will automatically restart when possible.unknown
indicates that an unidentified error has occured in the service.
Possible values: [
running
,complete
,not_configured
,queued
,unknown
]Date in
RFC 3339
format indicating the time of the next crawl attempt.
Object containing smart document understanding information for this collection.
- SmartDocumentUnderstanding
When
true
, smart document understanding conversion is enabled for this collection. All collections created with a version date after2019-04-30
have smart document understanding enabled. Iffalse
, documents added to the collection are converted using the conversion settings specified in the configuration associated with the collection.The total number of pages annotated using smart document understanding in this collection.
The current number of pages that can be used for training smart document understanding. The
total_pages
number is calculated as the total number of pages identified from the documents listed in the total_documents field.The total number of documents in this collection that can be used to train smart document understanding. For lite plan collections, the maximum is the first 20 uploaded documents (not including HTML or JSON documents). For other plans, the maximum is the first 40 uploaded documents (not including HTML or JSON documents). When the maximum is reached, additional documents uploaded to the collection are not considered for training smart document understanding.
Information about custom smart document understanding fields that exist in this collection.
- CustomFields
The number of custom fields defined for this collection.
The maximum number of custom fields that are allowed in this collection.
Status Code
Successful response.
Bad request.
{ "collections": [ { "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37", "name": "example", "description": "this is a demo collection", "created": "2015-08-24T18:42:25.324Z", "updated": "2015-08-24T18:42:25.324Z", "status": "active", "configuration_id": "6963be41-2dea-4f79-8f52-127c63c479b0", "language": "en" } ] }
{ "collections": [ { "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37", "name": "example", "description": "this is a demo collection", "created": "2015-08-24T18:42:25.324Z", "updated": "2015-08-24T18:42:25.324Z", "status": "active", "configuration_id": "6963be41-2dea-4f79-8f52-127c63c479b0", "language": "en" } ] }
Get collection details
GET /v1/environments/{environment_id}/collections/{collection_id}
ServiceCall<Collection> getCollection(GetCollectionOptions getCollectionOptions)
getCollection(params)
get_collection(
self,
environment_id: str,
collection_id: str,
**kwargs,
) -> DetailedResponse
GetCollection(string environmentId, string collectionId)
Request
Use the GetCollectionOptions.Builder
to create a GetCollectionOptions
object that contains the parameter values for the getCollection
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The getCollection options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.GetCollection( environmentId: "{environmentId}", collectionId: "{collectionId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; GetCollectionOptions getOptions = new GetCollectionOptions.Builder(environmentId, collectionId).build(); Collection getResponse = discovery.getCollection(getOptions).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const getCollectionParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', }; discovery.getCollection(getCollectionParams) .then(collection => { console.log(JSON.stringify(collection, null, 2)); }) .catch(err => { console.log('error:', err); });
import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') collection = discovery.get_collection( '{environment_id}', '{collection_id}').get_result() print(json.dumps(collection, indent=2))
Response
A collection for storing documents.
The unique identifier of the collection.
The name of the collection.
Possible values: 0 ≤ length ≤ 255
The description of the collection.
The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'
The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
The status of the collection.
Possible values: [
active
,pending
,maintenance
]The unique identifier of the collection's configuration.
The language of the documents stored in the collection. Permitted values include
en
(English),de
(German), andes
(Spanish).Object containing collection document count information.
Summary of the disk usage statistics for this collection.
Training status details.
Object containing information about the crawl status of this collection.
- crawl_status
Object containing source crawl status information.
Object containing smart document understanding information for this collection.
A collection for storing documents.
{
"collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
"name": "test-collection",
"configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
"language": "de",
"status": "active",
"description": "A test collection to show as an example",
"created": "2017-07-14T12:55:40.652Z",
"updated": "2017-07-14T12:55:40.652Z",
"document_counts": {
"available": 0,
"processing": 0,
"failed": 0
},
"disk_usage": {
"used_bytes": 260
},
"training_status": {
"data_updated": "",
"total_examples": 0,
"sufficient_label_diversity": false,
"processing": false,
"minimum_examples_added": false,
"successfully_trained": "",
"available": false,
"notices": 0,
"minimum_queries_added": false
},
"crawl_status": {
"source_crawl": {
"status": "complete",
"last_updated": "2018-01-05T12:55:40.652Z"
}
},
"smart_document_understanding": {
"enabled": true,
"total_annotated_pages": 0,
"total_pages": 0,
"total_documents": 0,
"custom_fields": {
"maximum_allowed": 5
}
}
}
The unique identifier of the collection.
The name of the collection.
Possible values: 0 ≤ length ≤ 255
The description of the collection.
The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'.
The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The status of the collection.
Possible values: [
active
,pending
,maintenance
]The unique identifier of the collection's configuration.
The language of the documents stored in the collection. Permitted values include
en
(English),de
(German), andes
(Spanish).Object containing collection document count information.
- documentCounts
The total number of available documents in the collection.
The number of documents in the collection that are currently being processed.
The number of documents in the collection that failed to be ingested.
The number of documents that have been uploaded to the collection, but have not yet started processing.
Summary of the disk usage statistics for this collection.
- diskUsage
Number of bytes used by the collection.
Training status details.
- trainingStatus
The total number of training examples uploaded to this collection.
When
true
, the collection has been successfully trained.When
true
, the collection is currently processing training.When
true
, the collection has a sufficent amount of queries added for training to occur.When
true
, the collection has a sufficent amount of examples added for training to occur.When
true
, the collection has a sufficent amount of diversity in labeled results for training to occur.The number of notices associated with this data set.
The timestamp of when the collection was successfully trained.
The timestamp of when the data was uploaded.
Object containing information about the crawl status of this collection.
- crawlStatus
Object containing source crawl status information.
- sourceCrawl
The current status of the source crawl for this collection. This field returns
not_configured
if the default configuration for this source does not have a source object defined.running
indicates that a crawl to fetch more documents is in progress.complete
indicates that the crawl has completed with no errors.queued
indicates that the crawl has been paused by the system and will automatically restart when possible.unknown
indicates that an unidentified error has occured in the service.
Possible values: [
running
,complete
,not_configured
,queued
,unknown
]Date in
RFC 3339
format indicating the time of the next crawl attempt.
Object containing smart document understanding information for this collection.
- smartDocumentUnderstanding
When
true
, smart document understanding conversion is enabled for this collection. All collections created with a version date after2019-04-30
have smart document understanding enabled. Iffalse
, documents added to the collection are converted using the conversion settings specified in the configuration associated with the collection.The total number of pages annotated using smart document understanding in this collection.
The current number of pages that can be used for training smart document understanding. The
total_pages
number is calculated as the total number of pages identified from the documents listed in the total_documents field.The total number of documents in this collection that can be used to train smart document understanding. For lite plan collections, the maximum is the first 20 uploaded documents (not including HTML or JSON documents). For other plans, the maximum is the first 40 uploaded documents (not including HTML or JSON documents). When the maximum is reached, additional documents uploaded to the collection are not considered for training smart document understanding.
Information about custom smart document understanding fields that exist in this collection.
- customFields
The number of custom fields defined for this collection.
The maximum number of custom fields that are allowed in this collection.
A collection for storing documents.
{
"collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
"name": "test-collection",
"configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
"language": "de",
"status": "active",
"description": "A test collection to show as an example",
"created": "2017-07-14T12:55:40.652Z",
"updated": "2017-07-14T12:55:40.652Z",
"document_counts": {
"available": 0,
"processing": 0,
"failed": 0
},
"disk_usage": {
"used_bytes": 260
},
"training_status": {
"data_updated": "",
"total_examples": 0,
"sufficient_label_diversity": false,
"processing": false,
"minimum_examples_added": false,
"successfully_trained": "",
"available": false,
"notices": 0,
"minimum_queries_added": false
},
"crawl_status": {
"source_crawl": {
"status": "complete",
"last_updated": "2018-01-05T12:55:40.652Z"
}
},
"smart_document_understanding": {
"enabled": true,
"total_annotated_pages": 0,
"total_pages": 0,
"total_documents": 0,
"custom_fields": {
"maximum_allowed": 5
}
}
}
The unique identifier of the collection.
The name of the collection.
Possible values: 0 ≤ length ≤ 255
The description of the collection.
The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'.
The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The status of the collection.
Possible values: [
active
,pending
,maintenance
]The unique identifier of the collection's configuration.
The language of the documents stored in the collection. Permitted values include
en
(English),de
(German), andes
(Spanish).Object containing collection document count information.
- document_counts
The total number of available documents in the collection.
The number of documents in the collection that are currently being processed.
The number of documents in the collection that failed to be ingested.
The number of documents that have been uploaded to the collection, but have not yet started processing.
Summary of the disk usage statistics for this collection.
- disk_usage
Number of bytes used by the collection.
Training status details.
- training_status
The total number of training examples uploaded to this collection.
When
true
, the collection has been successfully trained.When
true
, the collection is currently processing training.When
true
, the collection has a sufficent amount of queries added for training to occur.When
true
, the collection has a sufficent amount of examples added for training to occur.When
true
, the collection has a sufficent amount of diversity in labeled results for training to occur.The number of notices associated with this data set.
The timestamp of when the collection was successfully trained.
The timestamp of when the data was uploaded.
Object containing information about the crawl status of this collection.
- crawl_status
Object containing source crawl status information.
- source_crawl
The current status of the source crawl for this collection. This field returns
not_configured
if the default configuration for this source does not have a source object defined.running
indicates that a crawl to fetch more documents is in progress.complete
indicates that the crawl has completed with no errors.queued
indicates that the crawl has been paused by the system and will automatically restart when possible.unknown
indicates that an unidentified error has occured in the service.
Possible values: [
running
,complete
,not_configured
,queued
,unknown
]Date in
RFC 3339
format indicating the time of the next crawl attempt.
Object containing smart document understanding information for this collection.
- smart_document_understanding
When
true
, smart document understanding conversion is enabled for this collection. All collections created with a version date after2019-04-30
have smart document understanding enabled. Iffalse
, documents added to the collection are converted using the conversion settings specified in the configuration associated with the collection.The total number of pages annotated using smart document understanding in this collection.
The current number of pages that can be used for training smart document understanding. The
total_pages
number is calculated as the total number of pages identified from the documents listed in the total_documents field.The total number of documents in this collection that can be used to train smart document understanding. For lite plan collections, the maximum is the first 20 uploaded documents (not including HTML or JSON documents). For other plans, the maximum is the first 40 uploaded documents (not including HTML or JSON documents). When the maximum is reached, additional documents uploaded to the collection are not considered for training smart document understanding.
Information about custom smart document understanding fields that exist in this collection.
- custom_fields
The number of custom fields defined for this collection.
The maximum number of custom fields that are allowed in this collection.
A collection for storing documents.
{
"collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
"name": "test-collection",
"configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
"language": "de",
"status": "active",
"description": "A test collection to show as an example",
"created": "2017-07-14T12:55:40.652Z",
"updated": "2017-07-14T12:55:40.652Z",
"document_counts": {
"available": 0,
"processing": 0,
"failed": 0
},
"disk_usage": {
"used_bytes": 260
},
"training_status": {
"data_updated": "",
"total_examples": 0,
"sufficient_label_diversity": false,
"processing": false,
"minimum_examples_added": false,
"successfully_trained": "",
"available": false,
"notices": 0,
"minimum_queries_added": false
},
"crawl_status": {
"source_crawl": {
"status": "complete",
"last_updated": "2018-01-05T12:55:40.652Z"
}
},
"smart_document_understanding": {
"enabled": true,
"total_annotated_pages": 0,
"total_pages": 0,
"total_documents": 0,
"custom_fields": {
"maximum_allowed": 5
}
}
}
The unique identifier of the collection.
The name of the collection.
Possible values: 0 ≤ length ≤ 255
The description of the collection.
The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'.
The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The status of the collection.
Possible values: [
active
,pending
,maintenance
]The unique identifier of the collection's configuration.
The language of the documents stored in the collection. Permitted values include
en
(English),de
(German), andes
(Spanish).Object containing collection document count information.
- document_counts
The total number of available documents in the collection.
The number of documents in the collection that are currently being processed.
The number of documents in the collection that failed to be ingested.
The number of documents that have been uploaded to the collection, but have not yet started processing.
Summary of the disk usage statistics for this collection.
- disk_usage
Number of bytes used by the collection.
Training status details.
- training_status
The total number of training examples uploaded to this collection.
When
true
, the collection has been successfully trained.When
true
, the collection is currently processing training.When
true
, the collection has a sufficent amount of queries added for training to occur.When
true
, the collection has a sufficent amount of examples added for training to occur.When
true
, the collection has a sufficent amount of diversity in labeled results for training to occur.The number of notices associated with this data set.
The timestamp of when the collection was successfully trained.
The timestamp of when the data was uploaded.
Object containing information about the crawl status of this collection.
- crawl_status
Object containing source crawl status information.
- source_crawl
The current status of the source crawl for this collection. This field returns
not_configured
if the default configuration for this source does not have a source object defined.running
indicates that a crawl to fetch more documents is in progress.complete
indicates that the crawl has completed with no errors.queued
indicates that the crawl has been paused by the system and will automatically restart when possible.unknown
indicates that an unidentified error has occured in the service.
Possible values: [
running
,complete
,not_configured
,queued
,unknown
]Date in
RFC 3339
format indicating the time of the next crawl attempt.
Object containing smart document understanding information for this collection.
- smart_document_understanding
When
true
, smart document understanding conversion is enabled for this collection. All collections created with a version date after2019-04-30
have smart document understanding enabled. Iffalse
, documents added to the collection are converted using the conversion settings specified in the configuration associated with the collection.The total number of pages annotated using smart document understanding in this collection.
The current number of pages that can be used for training smart document understanding. The
total_pages
number is calculated as the total number of pages identified from the documents listed in the total_documents field.The total number of documents in this collection that can be used to train smart document understanding. For lite plan collections, the maximum is the first 20 uploaded documents (not including HTML or JSON documents). For other plans, the maximum is the first 40 uploaded documents (not including HTML or JSON documents). When the maximum is reached, additional documents uploaded to the collection are not considered for training smart document understanding.
Information about custom smart document understanding fields that exist in this collection.
- custom_fields
The number of custom fields defined for this collection.
The maximum number of custom fields that are allowed in this collection.
A collection for storing documents.
{
"collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
"name": "test-collection",
"configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
"language": "de",
"status": "active",
"description": "A test collection to show as an example",
"created": "2017-07-14T12:55:40.652Z",
"updated": "2017-07-14T12:55:40.652Z",
"document_counts": {
"available": 0,
"processing": 0,
"failed": 0
},
"disk_usage": {
"used_bytes": 260
},
"training_status": {
"data_updated": "",
"total_examples": 0,
"sufficient_label_diversity": false,
"processing": false,
"minimum_examples_added": false,
"successfully_trained": "",
"available": false,
"notices": 0,
"minimum_queries_added": false
},
"crawl_status": {
"source_crawl": {
"status": "complete",
"last_updated": "2018-01-05T12:55:40.652Z"
}
},
"smart_document_understanding": {
"enabled": true,
"total_annotated_pages": 0,
"total_pages": 0,
"total_documents": 0,
"custom_fields": {
"maximum_allowed": 5
}
}
}
The unique identifier of the collection.
The name of the collection.
Possible values: 0 ≤ length ≤ 255
The description of the collection.
The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'.
The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The status of the collection.
Possible values: [
active
,pending
,maintenance
]The unique identifier of the collection's configuration.
The language of the documents stored in the collection. Permitted values include
en
(English),de
(German), andes
(Spanish).Object containing collection document count information.
- DocumentCounts
The total number of available documents in the collection.
The number of documents in the collection that are currently being processed.
The number of documents in the collection that failed to be ingested.
The number of documents that have been uploaded to the collection, but have not yet started processing.
Summary of the disk usage statistics for this collection.
- DiskUsage
Number of bytes used by the collection.
Training status details.
- TrainingStatus
The total number of training examples uploaded to this collection.
When
true
, the collection has been successfully trained.When
true
, the collection is currently processing training.When
true
, the collection has a sufficent amount of queries added for training to occur.When
true
, the collection has a sufficent amount of examples added for training to occur.When
true
, the collection has a sufficent amount of diversity in labeled results for training to occur.The number of notices associated with this data set.
The timestamp of when the collection was successfully trained.
The timestamp of when the data was uploaded.
Object containing information about the crawl status of this collection.
- CrawlStatus
Object containing source crawl status information.
- SourceCrawl
The current status of the source crawl for this collection. This field returns
not_configured
if the default configuration for this source does not have a source object defined.running
indicates that a crawl to fetch more documents is in progress.complete
indicates that the crawl has completed with no errors.queued
indicates that the crawl has been paused by the system and will automatically restart when possible.unknown
indicates that an unidentified error has occured in the service.
Possible values: [
running
,complete
,not_configured
,queued
,unknown
]Date in
RFC 3339
format indicating the time of the next crawl attempt.
Object containing smart document understanding information for this collection.
- SmartDocumentUnderstanding
When
true
, smart document understanding conversion is enabled for this collection. All collections created with a version date after2019-04-30
have smart document understanding enabled. Iffalse
, documents added to the collection are converted using the conversion settings specified in the configuration associated with the collection.The total number of pages annotated using smart document understanding in this collection.
The current number of pages that can be used for training smart document understanding. The
total_pages
number is calculated as the total number of pages identified from the documents listed in the total_documents field.The total number of documents in this collection that can be used to train smart document understanding. For lite plan collections, the maximum is the first 20 uploaded documents (not including HTML or JSON documents). For other plans, the maximum is the first 40 uploaded documents (not including HTML or JSON documents). When the maximum is reached, additional documents uploaded to the collection are not considered for training smart document understanding.
Information about custom smart document understanding fields that exist in this collection.
- CustomFields
The number of custom fields defined for this collection.
The maximum number of custom fields that are allowed in this collection.
Status Code
Collection fetched.
Bad request.
{ "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96", "name": "test-collection", "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3", "language": "de", "status": "active", "description": "A test collection to show as an example", "created": "2017-07-14T12:55:40.652Z", "updated": "2017-07-14T12:55:40.652Z", "document_counts": { "available": 0, "processing": 0, "failed": 0 }, "disk_usage": { "used_bytes": 260 }, "training_status": { "data_updated": "", "total_examples": 0, "sufficient_label_diversity": false, "processing": false, "minimum_examples_added": false, "successfully_trained": "", "available": false, "notices": 0, "minimum_queries_added": false }, "crawl_status": { "source_crawl": { "status": "complete", "last_updated": "2018-01-05T12:55:40.652Z" } }, "smart_document_understanding": { "enabled": true, "total_annotated_pages": 0, "total_pages": 0, "total_documents": 0, "custom_fields": { "maximum_allowed": 5 } } }
{ "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96", "name": "test-collection", "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3", "language": "de", "status": "active", "description": "A test collection to show as an example", "created": "2017-07-14T12:55:40.652Z", "updated": "2017-07-14T12:55:40.652Z", "document_counts": { "available": 0, "processing": 0, "failed": 0 }, "disk_usage": { "used_bytes": 260 }, "training_status": { "data_updated": "", "total_examples": 0, "sufficient_label_diversity": false, "processing": false, "minimum_examples_added": false, "successfully_trained": "", "available": false, "notices": 0, "minimum_queries_added": false }, "crawl_status": { "source_crawl": { "status": "complete", "last_updated": "2018-01-05T12:55:40.652Z" } }, "smart_document_understanding": { "enabled": true, "total_annotated_pages": 0, "total_pages": 0, "total_documents": 0, "custom_fields": { "maximum_allowed": 5 } } }
Update a collection
PUT /v1/environments/{environment_id}/collections/{collection_id}
ServiceCall<Collection> updateCollection(UpdateCollectionOptions updateCollectionOptions)
updateCollection(params)
update_collection(
self,
environment_id: str,
collection_id: str,
name: str,
*,
description: str = None,
configuration_id: str = None,
**kwargs,
) -> DetailedResponse
UpdateCollection(string environmentId, string collectionId, string name, string description = null, string configurationId = null)
Request
Use the UpdateCollectionOptions.Builder
to create a UpdateCollectionOptions
object that contains the parameter values for the updateCollection
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
Input an object that allows you to update a collection.
The name of the collection.
Possible values: 0 ≤ length ≤ 255
A description of the collection.
Default:
The ID of the configuration in which the collection is to be updated.
Default:
The updateCollection options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The name of the collection.
Possible values: 0 ≤ length ≤ 255
A description of the collection.
Default:
The ID of the configuration in which the collection is to be updated.
Default:
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The name of the collection.
Possible values: 0 ≤ length ≤ 255
A description of the collection.
Default:
The ID of the configuration in which the collection is to be updated.
Default:
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The name of the collection.
Possible values: 0 ≤ length ≤ 255
A description of the collection.
Default:
The ID of the configuration in which the collection is to be updated.
Default:
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The name of the collection.
Possible values: 0 ≤ length ≤ 255
A description of the collection.
Default:
The ID of the configuration in which the collection is to be updated.
Default:
curl -X PUT -u "apikey":"{apikey}" -H "Content-Type: application/json" -d '{ "name": "test_collection", "description": "My test collection", "configuration_id": "{configuration_id}" }' "{url}/v1/environments/{environment_id}/collections/{collection_id}?version=2019-04-30"
{ "name": "{collection_name}", "description": "{description}", "configuration_id": "{configuration_id}" }
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.UpdateCollection( environmentId: "{environmentId}", collectionId: "{collectionId}", name: "new_name" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; String newCollectionName = "new_name"; UpdateCollectionOptions updateOptions = new UpdateCollectionOptions.Builder(environmentId, collectionId) .name(newCollectionName) .build(); Collection updatedCollection = discovery.updateCollection(updateOptions).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const updateCollectionParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', name: '{updated name or current name if updating description (name is required)}', description: '{updated description}', }; discovery.updateCollection(updateCollectionParams) .then(collection => { console.log(JSON.stringify(collection, null, 2)); }) .catch(err => { console.log('error:', err); });
import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') updated_collection = discovery.update_collection( environment_id='{environment_id}', collection_id='{collection_id}', configuration_id='{configuration_id}', name='{collection_name}', description='{collection_desc}',).get_result() print(json.dumps(updated_collection, indent=2))
Response
A collection for storing documents.
The unique identifier of the collection.
The name of the collection.
Possible values: 0 ≤ length ≤ 255
The description of the collection.
The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'
The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
The status of the collection.
Possible values: [
active
,pending
,maintenance
]The unique identifier of the collection's configuration.
The language of the documents stored in the collection. Permitted values include
en
(English),de
(German), andes
(Spanish).Object containing collection document count information.
Summary of the disk usage statistics for this collection.
Training status details.
Object containing information about the crawl status of this collection.
- crawl_status
Object containing source crawl status information.
Object containing smart document understanding information for this collection.
A collection for storing documents.
{
"collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
"name": "test-collection",
"configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
"language": "de",
"status": "active",
"description": "A test collection to show as an example",
"created": "2017-07-14T12:55:40.652Z",
"updated": "2017-07-14T12:55:40.652Z",
"document_counts": {
"available": 0,
"processing": 0,
"failed": 0
},
"disk_usage": {
"used_bytes": 260
},
"training_status": {
"data_updated": "",
"total_examples": 0,
"sufficient_label_diversity": false,
"processing": false,
"minimum_examples_added": false,
"successfully_trained": "",
"available": false,
"notices": 0,
"minimum_queries_added": false
},
"crawl_status": {
"source_crawl": {
"status": "complete",
"last_updated": "2018-01-05T12:55:40.652Z"
}
},
"smart_document_understanding": {
"enabled": true,
"total_annotated_pages": 0,
"total_pages": 0,
"total_documents": 0,
"custom_fields": {
"maximum_allowed": 5
}
}
}
The unique identifier of the collection.
The name of the collection.
Possible values: 0 ≤ length ≤ 255
The description of the collection.
The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'.
The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The status of the collection.
Possible values: [
active
,pending
,maintenance
]The unique identifier of the collection's configuration.
The language of the documents stored in the collection. Permitted values include
en
(English),de
(German), andes
(Spanish).Object containing collection document count information.
- documentCounts
The total number of available documents in the collection.
The number of documents in the collection that are currently being processed.
The number of documents in the collection that failed to be ingested.
The number of documents that have been uploaded to the collection, but have not yet started processing.
Summary of the disk usage statistics for this collection.
- diskUsage
Number of bytes used by the collection.
Training status details.
- trainingStatus
The total number of training examples uploaded to this collection.
When
true
, the collection has been successfully trained.When
true
, the collection is currently processing training.When
true
, the collection has a sufficent amount of queries added for training to occur.When
true
, the collection has a sufficent amount of examples added for training to occur.When
true
, the collection has a sufficent amount of diversity in labeled results for training to occur.The number of notices associated with this data set.
The timestamp of when the collection was successfully trained.
The timestamp of when the data was uploaded.
Object containing information about the crawl status of this collection.
- crawlStatus
Object containing source crawl status information.
- sourceCrawl
The current status of the source crawl for this collection. This field returns
not_configured
if the default configuration for this source does not have a source object defined.running
indicates that a crawl to fetch more documents is in progress.complete
indicates that the crawl has completed with no errors.queued
indicates that the crawl has been paused by the system and will automatically restart when possible.unknown
indicates that an unidentified error has occured in the service.
Possible values: [
running
,complete
,not_configured
,queued
,unknown
]Date in
RFC 3339
format indicating the time of the next crawl attempt.
Object containing smart document understanding information for this collection.
- smartDocumentUnderstanding
When
true
, smart document understanding conversion is enabled for this collection. All collections created with a version date after2019-04-30
have smart document understanding enabled. Iffalse
, documents added to the collection are converted using the conversion settings specified in the configuration associated with the collection.The total number of pages annotated using smart document understanding in this collection.
The current number of pages that can be used for training smart document understanding. The
total_pages
number is calculated as the total number of pages identified from the documents listed in the total_documents field.The total number of documents in this collection that can be used to train smart document understanding. For lite plan collections, the maximum is the first 20 uploaded documents (not including HTML or JSON documents). For other plans, the maximum is the first 40 uploaded documents (not including HTML or JSON documents). When the maximum is reached, additional documents uploaded to the collection are not considered for training smart document understanding.
Information about custom smart document understanding fields that exist in this collection.
- customFields
The number of custom fields defined for this collection.
The maximum number of custom fields that are allowed in this collection.
A collection for storing documents.
{
"collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
"name": "test-collection",
"configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
"language": "de",
"status": "active",
"description": "A test collection to show as an example",
"created": "2017-07-14T12:55:40.652Z",
"updated": "2017-07-14T12:55:40.652Z",
"document_counts": {
"available": 0,
"processing": 0,
"failed": 0
},
"disk_usage": {
"used_bytes": 260
},
"training_status": {
"data_updated": "",
"total_examples": 0,
"sufficient_label_diversity": false,
"processing": false,
"minimum_examples_added": false,
"successfully_trained": "",
"available": false,
"notices": 0,
"minimum_queries_added": false
},
"crawl_status": {
"source_crawl": {
"status": "complete",
"last_updated": "2018-01-05T12:55:40.652Z"
}
},
"smart_document_understanding": {
"enabled": true,
"total_annotated_pages": 0,
"total_pages": 0,
"total_documents": 0,
"custom_fields": {
"maximum_allowed": 5
}
}
}
The unique identifier of the collection.
The name of the collection.
Possible values: 0 ≤ length ≤ 255
The description of the collection.
The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'.
The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The status of the collection.
Possible values: [
active
,pending
,maintenance
]The unique identifier of the collection's configuration.
The language of the documents stored in the collection. Permitted values include
en
(English),de
(German), andes
(Spanish).Object containing collection document count information.
- document_counts
The total number of available documents in the collection.
The number of documents in the collection that are currently being processed.
The number of documents in the collection that failed to be ingested.
The number of documents that have been uploaded to the collection, but have not yet started processing.
Summary of the disk usage statistics for this collection.
- disk_usage
Number of bytes used by the collection.
Training status details.
- training_status
The total number of training examples uploaded to this collection.
When
true
, the collection has been successfully trained.When
true
, the collection is currently processing training.When
true
, the collection has a sufficent amount of queries added for training to occur.When
true
, the collection has a sufficent amount of examples added for training to occur.When
true
, the collection has a sufficent amount of diversity in labeled results for training to occur.The number of notices associated with this data set.
The timestamp of when the collection was successfully trained.
The timestamp of when the data was uploaded.
Object containing information about the crawl status of this collection.
- crawl_status
Object containing source crawl status information.
- source_crawl
The current status of the source crawl for this collection. This field returns
not_configured
if the default configuration for this source does not have a source object defined.running
indicates that a crawl to fetch more documents is in progress.complete
indicates that the crawl has completed with no errors.queued
indicates that the crawl has been paused by the system and will automatically restart when possible.unknown
indicates that an unidentified error has occured in the service.
Possible values: [
running
,complete
,not_configured
,queued
,unknown
]Date in
RFC 3339
format indicating the time of the next crawl attempt.
Object containing smart document understanding information for this collection.
- smart_document_understanding
When
true
, smart document understanding conversion is enabled for this collection. All collections created with a version date after2019-04-30
have smart document understanding enabled. Iffalse
, documents added to the collection are converted using the conversion settings specified in the configuration associated with the collection.The total number of pages annotated using smart document understanding in this collection.
The current number of pages that can be used for training smart document understanding. The
total_pages
number is calculated as the total number of pages identified from the documents listed in the total_documents field.The total number of documents in this collection that can be used to train smart document understanding. For lite plan collections, the maximum is the first 20 uploaded documents (not including HTML or JSON documents). For other plans, the maximum is the first 40 uploaded documents (not including HTML or JSON documents). When the maximum is reached, additional documents uploaded to the collection are not considered for training smart document understanding.
Information about custom smart document understanding fields that exist in this collection.
- custom_fields
The number of custom fields defined for this collection.
The maximum number of custom fields that are allowed in this collection.
A collection for storing documents.
{
"collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
"name": "test-collection",
"configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
"language": "de",
"status": "active",
"description": "A test collection to show as an example",
"created": "2017-07-14T12:55:40.652Z",
"updated": "2017-07-14T12:55:40.652Z",
"document_counts": {
"available": 0,
"processing": 0,
"failed": 0
},
"disk_usage": {
"used_bytes": 260
},
"training_status": {
"data_updated": "",
"total_examples": 0,
"sufficient_label_diversity": false,
"processing": false,
"minimum_examples_added": false,
"successfully_trained": "",
"available": false,
"notices": 0,
"minimum_queries_added": false
},
"crawl_status": {
"source_crawl": {
"status": "complete",
"last_updated": "2018-01-05T12:55:40.652Z"
}
},
"smart_document_understanding": {
"enabled": true,
"total_annotated_pages": 0,
"total_pages": 0,
"total_documents": 0,
"custom_fields": {
"maximum_allowed": 5
}
}
}
The unique identifier of the collection.
The name of the collection.
Possible values: 0 ≤ length ≤ 255
The description of the collection.
The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'.
The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The status of the collection.
Possible values: [
active
,pending
,maintenance
]The unique identifier of the collection's configuration.
The language of the documents stored in the collection. Permitted values include
en
(English),de
(German), andes
(Spanish).Object containing collection document count information.
- document_counts
The total number of available documents in the collection.
The number of documents in the collection that are currently being processed.
The number of documents in the collection that failed to be ingested.
The number of documents that have been uploaded to the collection, but have not yet started processing.
Summary of the disk usage statistics for this collection.
- disk_usage
Number of bytes used by the collection.
Training status details.
- training_status
The total number of training examples uploaded to this collection.
When
true
, the collection has been successfully trained.When
true
, the collection is currently processing training.When
true
, the collection has a sufficent amount of queries added for training to occur.When
true
, the collection has a sufficent amount of examples added for training to occur.When
true
, the collection has a sufficent amount of diversity in labeled results for training to occur.The number of notices associated with this data set.
The timestamp of when the collection was successfully trained.
The timestamp of when the data was uploaded.
Object containing information about the crawl status of this collection.
- crawl_status
Object containing source crawl status information.
- source_crawl
The current status of the source crawl for this collection. This field returns
not_configured
if the default configuration for this source does not have a source object defined.running
indicates that a crawl to fetch more documents is in progress.complete
indicates that the crawl has completed with no errors.queued
indicates that the crawl has been paused by the system and will automatically restart when possible.unknown
indicates that an unidentified error has occured in the service.
Possible values: [
running
,complete
,not_configured
,queued
,unknown
]Date in
RFC 3339
format indicating the time of the next crawl attempt.
Object containing smart document understanding information for this collection.
- smart_document_understanding
When
true
, smart document understanding conversion is enabled for this collection. All collections created with a version date after2019-04-30
have smart document understanding enabled. Iffalse
, documents added to the collection are converted using the conversion settings specified in the configuration associated with the collection.The total number of pages annotated using smart document understanding in this collection.
The current number of pages that can be used for training smart document understanding. The
total_pages
number is calculated as the total number of pages identified from the documents listed in the total_documents field.The total number of documents in this collection that can be used to train smart document understanding. For lite plan collections, the maximum is the first 20 uploaded documents (not including HTML or JSON documents). For other plans, the maximum is the first 40 uploaded documents (not including HTML or JSON documents). When the maximum is reached, additional documents uploaded to the collection are not considered for training smart document understanding.
Information about custom smart document understanding fields that exist in this collection.
- custom_fields
The number of custom fields defined for this collection.
The maximum number of custom fields that are allowed in this collection.
A collection for storing documents.
{
"collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
"name": "test-collection",
"configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
"language": "de",
"status": "active",
"description": "A test collection to show as an example",
"created": "2017-07-14T12:55:40.652Z",
"updated": "2017-07-14T12:55:40.652Z",
"document_counts": {
"available": 0,
"processing": 0,
"failed": 0
},
"disk_usage": {
"used_bytes": 260
},
"training_status": {
"data_updated": "",
"total_examples": 0,
"sufficient_label_diversity": false,
"processing": false,
"minimum_examples_added": false,
"successfully_trained": "",
"available": false,
"notices": 0,
"minimum_queries_added": false
},
"crawl_status": {
"source_crawl": {
"status": "complete",
"last_updated": "2018-01-05T12:55:40.652Z"
}
},
"smart_document_understanding": {
"enabled": true,
"total_annotated_pages": 0,
"total_pages": 0,
"total_documents": 0,
"custom_fields": {
"maximum_allowed": 5
}
}
}
The unique identifier of the collection.
The name of the collection.
Possible values: 0 ≤ length ≤ 255
The description of the collection.
The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'.
The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
The status of the collection.
Possible values: [
active
,pending
,maintenance
]The unique identifier of the collection's configuration.
The language of the documents stored in the collection. Permitted values include
en
(English),de
(German), andes
(Spanish).Object containing collection document count information.
- DocumentCounts
The total number of available documents in the collection.
The number of documents in the collection that are currently being processed.
The number of documents in the collection that failed to be ingested.
The number of documents that have been uploaded to the collection, but have not yet started processing.
Summary of the disk usage statistics for this collection.
- DiskUsage
Number of bytes used by the collection.
Training status details.
- TrainingStatus
The total number of training examples uploaded to this collection.
When
true
, the collection has been successfully trained.When
true
, the collection is currently processing training.When
true
, the collection has a sufficent amount of queries added for training to occur.When
true
, the collection has a sufficent amount of examples added for training to occur.When
true
, the collection has a sufficent amount of diversity in labeled results for training to occur.The number of notices associated with this data set.
The timestamp of when the collection was successfully trained.
The timestamp of when the data was uploaded.
Object containing information about the crawl status of this collection.
- CrawlStatus
Object containing source crawl status information.
- SourceCrawl
The current status of the source crawl for this collection. This field returns
not_configured
if the default configuration for this source does not have a source object defined.running
indicates that a crawl to fetch more documents is in progress.complete
indicates that the crawl has completed with no errors.queued
indicates that the crawl has been paused by the system and will automatically restart when possible.unknown
indicates that an unidentified error has occured in the service.
Possible values: [
running
,complete
,not_configured
,queued
,unknown
]Date in
RFC 3339
format indicating the time of the next crawl attempt.
Object containing smart document understanding information for this collection.
- SmartDocumentUnderstanding
When
true
, smart document understanding conversion is enabled for this collection. All collections created with a version date after2019-04-30
have smart document understanding enabled. Iffalse
, documents added to the collection are converted using the conversion settings specified in the configuration associated with the collection.The total number of pages annotated using smart document understanding in this collection.
The current number of pages that can be used for training smart document understanding. The
total_pages
number is calculated as the total number of pages identified from the documents listed in the total_documents field.The total number of documents in this collection that can be used to train smart document understanding. For lite plan collections, the maximum is the first 20 uploaded documents (not including HTML or JSON documents). For other plans, the maximum is the first 40 uploaded documents (not including HTML or JSON documents). When the maximum is reached, additional documents uploaded to the collection are not considered for training smart document understanding.
Information about custom smart document understanding fields that exist in this collection.
- CustomFields
The number of custom fields defined for this collection.
The maximum number of custom fields that are allowed in this collection.
Status Code
Collection successfully updated.
Bad request if the collection body does not match the expected format or if the configuration_id references a configuration that does not exist. The error string will describe why the request was rejected.
Forbidden. Returned if you attempt to update a collection in a read-only environment.
{ "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96", "name": "test-collection", "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3", "language": "de", "status": "active", "description": "A test collection to show as an example", "created": "2017-07-14T12:55:40.652Z", "updated": "2017-07-14T12:55:40.652Z", "document_counts": { "available": 0, "processing": 0, "failed": 0 }, "disk_usage": { "used_bytes": 260 }, "training_status": { "data_updated": "", "total_examples": 0, "sufficient_label_diversity": false, "processing": false, "minimum_examples_added": false, "successfully_trained": "", "available": false, "notices": 0, "minimum_queries_added": false }, "crawl_status": { "source_crawl": { "status": "complete", "last_updated": "2018-01-05T12:55:40.652Z" } }, "smart_document_understanding": { "enabled": true, "total_annotated_pages": 0, "total_pages": 0, "total_documents": 0, "custom_fields": { "maximum_allowed": 5 } } }
{ "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96", "name": "test-collection", "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3", "language": "de", "status": "active", "description": "A test collection to show as an example", "created": "2017-07-14T12:55:40.652Z", "updated": "2017-07-14T12:55:40.652Z", "document_counts": { "available": 0, "processing": 0, "failed": 0 }, "disk_usage": { "used_bytes": 260 }, "training_status": { "data_updated": "", "total_examples": 0, "sufficient_label_diversity": false, "processing": false, "minimum_examples_added": false, "successfully_trained": "", "available": false, "notices": 0, "minimum_queries_added": false }, "crawl_status": { "source_crawl": { "status": "complete", "last_updated": "2018-01-05T12:55:40.652Z" } }, "smart_document_understanding": { "enabled": true, "total_annotated_pages": 0, "total_pages": 0, "total_documents": 0, "custom_fields": { "maximum_allowed": 5 } } }
Delete a collection
DELETE /v1/environments/{environment_id}/collections/{collection_id}
ServiceCall<DeleteCollectionResponse> deleteCollection(DeleteCollectionOptions deleteCollectionOptions)
deleteCollection(params)
delete_collection(
self,
environment_id: str,
collection_id: str,
**kwargs,
) -> DetailedResponse
DeleteCollection(string environmentId, string collectionId)
Request
Use the DeleteCollectionOptions.Builder
to create a DeleteCollectionOptions
object that contains the parameter values for the deleteCollection
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The deleteCollection options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -u "apikey":"{apikey}" -X DELETE "{url}/v1/environments/{environment_id}/collections/{collection_id}?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.DeleteCollection( environmentId: "{environmentId}", collectionId: "{collectionId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; DeleteCollectionOptions deleteRequest = new DeleteCollectionOptions.Builder(environmentId, collectionId).build(); DeleteCollectionResponse deleteResponse = discovery.deleteCollection(deleteRequest).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const deleteCollectionParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', }; discovery.deleteCollection(deleteCollectionParams) .then(deleteCollectionResponse => { console.log(JSON.stringify(deleteCollectionResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') delete_collection = discovery.delete_collection( '{environment_id}', '{collection_id}').get_result() print(json.dumps(delete_collection, indent=2))
Response
Response object returned when deleting a colleciton.
The unique identifier of the collection that is being deleted.
The status of the collection. The status of a successful deletion operation is
deleted
.Possible values: [
deleted
]
Response object returned when deleting a colleciton.
The unique identifier of the collection that is being deleted.
The status of the collection. The status of a successful deletion operation is
deleted
.Possible values: [
deleted
]
Response object returned when deleting a colleciton.
The unique identifier of the collection that is being deleted.
The status of the collection. The status of a successful deletion operation is
deleted
.Possible values: [
deleted
]
Response object returned when deleting a colleciton.
The unique identifier of the collection that is being deleted.
The status of the collection. The status of a successful deletion operation is
deleted
.Possible values: [
deleted
]
Response object returned when deleting a colleciton.
The unique identifier of the collection that is being deleted.
The status of the collection. The status of a successful deletion operation is
deleted
.Possible values: [
deleted
]
Status Code
Collection successfully deleted.
Bad request.
A bad request is returned any time there is a problem with the request itself.
Example error messages:
Could not find listed collection
- if the ID is incorrectly formatted.
Forbidden. Returned if you attempt to delete a collection in a read-only environment.
Returned any time the collection is not found (even immediately after the collection was successfully deleted).
Example error message:
A collection with ID '2cd8bc72-d737-46e3-b26b-05a585111111' was not found.
No Sample Response
List collection fields
Gets a list of the unique fields (and their types) stored in the index.
Gets a list of the unique fields (and their types) stored in the index.
Gets a list of the unique fields (and their types) stored in the index.
Gets a list of the unique fields (and their types) stored in the index.
Gets a list of the unique fields (and their types) stored in the index.
GET /v1/environments/{environment_id}/collections/{collection_id}/fields
ServiceCall<ListCollectionFieldsResponse> listCollectionFields(ListCollectionFieldsOptions listCollectionFieldsOptions)
listCollectionFields(params)
list_collection_fields(
self,
environment_id: str,
collection_id: str,
**kwargs,
) -> DetailedResponse
ListCollectionFields(string environmentId, string collectionId)
Request
Use the ListCollectionFieldsOptions.Builder
to create a ListCollectionFieldsOptions
object that contains the parameter values for the listCollectionFields
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The listCollectionFields options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/fields?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.ListCollectionFields( environmentId: "{environmentId}", collectionId: "{collectionId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; ListCollectionFieldsOptions listOptions = new ListCollectionFieldsOptions.Builder(environmentId, collectionId).build(); ListCollectionFieldsResponse listResponse = discovery.listCollectionFields(listOptions).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const listCollectionFieldsParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', }; discovery.listCollectionFields(listCollectionFieldsParams) .then(listCollectionFieldsResponse => { console.log(JSON.stringify(listCollectionFieldsResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') collection_fields = discovery.list_collection_fields( '{environment_id}', '{collection_id}').get_result() print(json.dumps(collection_fields, indent=2))
Response
The list of fetched fields.
The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.
-
Fields which contain nested JSON objects are assigned a type of "nested".
-
Fields which belong to a nested object are prefixed with
.properties
(for example,warnings.properties.severity
means that thewarnings
object has a property calledseverity
). -
Fields returned from the News collection are prefixed with
v{N}-fullnews-t3-{YEAR}.mappings
(for example,v5-fullnews-t3-2016.mappings.text.properties.author
).
An array containing information about each field in the collections.
The list of fetched fields.
The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.
-
Fields which contain nested JSON objects are assigned a type of "nested".
-
Fields which belong to a nested object are prefixed with
.properties
(for example,warnings.properties.severity
means that thewarnings
object has a property calledseverity
). -
Fields returned from the News collection are prefixed with
v{N}-fullnews-t3-{YEAR}.mappings
(for example,v5-fullnews-t3-2016.mappings.text.properties.author
).
{
"fields": [
{
"field": "warnings",
"type": "nested"
},
{
"field": "warnings.properties.description",
"type": "string"
},
{
"field": "warnings.properties.phase",
"type": "string"
},
{
"field": "warnings.properties.warning_id",
"type": "string"
}
]
}
An array containing information about each field in the collections.
- fields
The name of the field.
The type of the field.
Possible values: [
nested
,string
,date
,long
,integer
,short
,byte
,double
,float
,boolean
,binary
]
The list of fetched fields.
The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.
-
Fields which contain nested JSON objects are assigned a type of "nested".
-
Fields which belong to a nested object are prefixed with
.properties
(for example,warnings.properties.severity
means that thewarnings
object has a property calledseverity
). -
Fields returned from the News collection are prefixed with
v{N}-fullnews-t3-{YEAR}.mappings
(for example,v5-fullnews-t3-2016.mappings.text.properties.author
).
{
"fields": [
{
"field": "warnings",
"type": "nested"
},
{
"field": "warnings.properties.description",
"type": "string"
},
{
"field": "warnings.properties.phase",
"type": "string"
},
{
"field": "warnings.properties.warning_id",
"type": "string"
}
]
}
An array containing information about each field in the collections.
- fields
The name of the field.
The type of the field.
Possible values: [
nested
,string
,date
,long
,integer
,short
,byte
,double
,float
,boolean
,binary
]
The list of fetched fields.
The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.
-
Fields which contain nested JSON objects are assigned a type of "nested".
-
Fields which belong to a nested object are prefixed with
.properties
(for example,warnings.properties.severity
means that thewarnings
object has a property calledseverity
). -
Fields returned from the News collection are prefixed with
v{N}-fullnews-t3-{YEAR}.mappings
(for example,v5-fullnews-t3-2016.mappings.text.properties.author
).
{
"fields": [
{
"field": "warnings",
"type": "nested"
},
{
"field": "warnings.properties.description",
"type": "string"
},
{
"field": "warnings.properties.phase",
"type": "string"
},
{
"field": "warnings.properties.warning_id",
"type": "string"
}
]
}
An array containing information about each field in the collections.
- fields
The name of the field.
The type of the field.
Possible values: [
nested
,string
,date
,long
,integer
,short
,byte
,double
,float
,boolean
,binary
]
The list of fetched fields.
The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.
-
Fields which contain nested JSON objects are assigned a type of "nested".
-
Fields which belong to a nested object are prefixed with
.properties
(for example,warnings.properties.severity
means that thewarnings
object has a property calledseverity
). -
Fields returned from the News collection are prefixed with
v{N}-fullnews-t3-{YEAR}.mappings
(for example,v5-fullnews-t3-2016.mappings.text.properties.author
).
{
"fields": [
{
"field": "warnings",
"type": "nested"
},
{
"field": "warnings.properties.description",
"type": "string"
},
{
"field": "warnings.properties.phase",
"type": "string"
},
{
"field": "warnings.properties.warning_id",
"type": "string"
}
]
}
An array containing information about each field in the collections.
- Fields
The name of the field.
The type of the field.
Possible values: [
nested
,string
,date
,long
,integer
,short
,byte
,double
,float
,boolean
,binary
]
Status Code
The list of fetched fields.
The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations:
-
Fields which contain nested JSON objects are assigned a type of "nested".
-
Fields which belong to a nested object are prefixed with
.properties
(for example,warnings.properties.severity
means that thewarnings
object has a property calledseverity
). -
Fields returned from the News collection are prefixed with
v{N}-fullnews-t3-{YEAR}.mappings
(for example,v5-fullnews-t3-2016.mappings.text.properties.author
).
-
Bad request.
{ "fields": [ { "field": "warnings", "type": "nested" }, { "field": "warnings.properties.description", "type": "string" }, { "field": "warnings.properties.phase", "type": "string" }, { "field": "warnings.properties.warning_id", "type": "string" } ] }
{ "fields": [ { "field": "warnings", "type": "nested" }, { "field": "warnings.properties.description", "type": "string" }, { "field": "warnings.properties.phase", "type": "string" }, { "field": "warnings.properties.warning_id", "type": "string" } ] }
Get the expansion list
Returns the current expansion list for the specified collection. If an expansion list is not specified, an object with empty expansion arrays is returned.
Returns the current expansion list for the specified collection. If an expansion list is not specified, an object with empty expansion arrays is returned.
Returns the current expansion list for the specified collection. If an expansion list is not specified, an object with empty expansion arrays is returned.
Returns the current expansion list for the specified collection. If an expansion list is not specified, an object with empty expansion arrays is returned.
Returns the current expansion list for the specified collection. If an expansion list is not specified, an object with empty expansion arrays is returned.
GET /v1/environments/{environment_id}/collections/{collection_id}/expansions
ServiceCall<Expansions> listExpansions(ListExpansionsOptions listExpansionsOptions)
listExpansions(params)
list_expansions(
self,
environment_id: str,
collection_id: str,
**kwargs,
) -> DetailedResponse
ListExpansions(string environmentId, string collectionId)
Request
Use the ListExpansionsOptions.Builder
to create a ListExpansionsOptions
object that contains the parameter values for the listExpansions
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The listExpansions options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -u "apikey":"{apikey}" -X GET "{url}/v1/environments/{environment_id}/collections/{collection_id}/expansions?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.ListExpansions( environmentId: "{environmentId}", collectionId: "{collectionId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; ListExpansionsOptions listOptions = new ListExpansionsOptions.Builder() .environmentId(environmentId) .collectionId(collectionId) .build(); Expansions listResults = discovery.listExpansions(listOptions).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const listExpansionsParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', }; discovery.listExpansions(listExpansionsParams) .then(expansions => { console.log(JSON.stringify(expansions, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
The query expansion definitions for the specified collection.
An array of query expansion definitions.
Each object in the expansions array represents a term or set of terms that will be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms.
To create a bi-directional expansion specify an expanded_terms array. When found in a query, all items in the expanded_terms array are then expanded to the other items in the same array.
To create a uni-directional expansion, specify both an array of input_terms and an array of expanded_terms. When items in the input_terms array are present in a query, they are expanded using the items listed in the expanded_terms array.
The query expansion definitions for the specified collection.
An array of query expansion definitions.
Each object in the expansions array represents a term or set of terms that will be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms.
To create a bi-directional expansion specify an expanded_terms array. When found in a query, all items in the expanded_terms array are then expanded to the other items in the same array.
To create a uni-directional expansion, specify both an array of input_terms and an array of expanded_terms. When items in the input_terms array are present in a query, they are expanded using the items listed in the expanded_terms array.
- expansions
A list of terms that will be expanded for this expansion. If specified, only the items in this list are expanded.
A list of terms that this expansion will be expanded to. If specified without input_terms, it also functions as the input term list.
The query expansion definitions for the specified collection.
An array of query expansion definitions.
Each object in the expansions array represents a term or set of terms that will be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms.
To create a bi-directional expansion specify an expanded_terms array. When found in a query, all items in the expanded_terms array are then expanded to the other items in the same array.
To create a uni-directional expansion, specify both an array of input_terms and an array of expanded_terms. When items in the input_terms array are present in a query, they are expanded using the items listed in the expanded_terms array.
- expansions
A list of terms that will be expanded for this expansion. If specified, only the items in this list are expanded.
A list of terms that this expansion will be expanded to. If specified without input_terms, it also functions as the input term list.
The query expansion definitions for the specified collection.
An array of query expansion definitions.
Each object in the expansions array represents a term or set of terms that will be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms.
To create a bi-directional expansion specify an expanded_terms array. When found in a query, all items in the expanded_terms array are then expanded to the other items in the same array.
To create a uni-directional expansion, specify both an array of input_terms and an array of expanded_terms. When items in the input_terms array are present in a query, they are expanded using the items listed in the expanded_terms array.
- expansions
A list of terms that will be expanded for this expansion. If specified, only the items in this list are expanded.
A list of terms that this expansion will be expanded to. If specified without input_terms, it also functions as the input term list.
The query expansion definitions for the specified collection.
An array of query expansion definitions.
Each object in the expansions array represents a term or set of terms that will be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms.
To create a bi-directional expansion specify an expanded_terms array. When found in a query, all items in the expanded_terms array are then expanded to the other items in the same array.
To create a uni-directional expansion, specify both an array of input_terms and an array of expanded_terms. When items in the input_terms array are present in a query, they are expanded using the items listed in the expanded_terms array.
- _Expansions
A list of terms that will be expanded for this expansion. If specified, only the items in this list are expanded.
A list of terms that this expansion will be expanded to. If specified without input_terms, it also functions as the input term list.
Status Code
Successfully fetched expansions details.
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
No Sample Response
Create or update expansion list
Create or replace the Expansion list for this collection. The maximum number of expanded terms per collection is 500
.
The current expansion list is replaced with the uploaded content.
Create or replace the Expansion list for this collection. The maximum number of expanded terms per collection is 500
. The current expansion list is replaced with the uploaded content.
Create or replace the Expansion list for this collection. The maximum number of expanded terms per collection is 500
. The current expansion list is replaced with the uploaded content.
Create or replace the Expansion list for this collection. The maximum number of expanded terms per collection is 500
. The current expansion list is replaced with the uploaded content.
Create or replace the Expansion list for this collection. The maximum number of expanded terms per collection is 500
. The current expansion list is replaced with the uploaded content.
POST /v1/environments/{environment_id}/collections/{collection_id}/expansions
ServiceCall<Expansions> createExpansions(CreateExpansionsOptions createExpansionsOptions)
createExpansions(params)
create_expansions(
self,
environment_id: str,
collection_id: str,
expansions: List['Expansion'],
**kwargs,
) -> DetailedResponse
CreateExpansions(string environmentId, string collectionId, List<Expansion> expansions)
Request
Use the CreateExpansionsOptions.Builder
to create a CreateExpansionsOptions
object that contains the parameter values for the createExpansions
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
An object that defines the expansion list.
An array of query expansion definitions.
Each object in the expansions array represents a term or set of terms that will be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms.
To create a bi-directional expansion specify an expanded_terms array. When found in a query, all items in the expanded_terms array are then expanded to the other items in the same array.
To create a uni-directional expansion, specify both an array of input_terms and an array of expanded_terms. When items in the input_terms array are present in a query, they are expanded using the items listed in the expanded_terms array.
The createExpansions options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
An array of query expansion definitions.
Each object in the expansions array represents a term or set of terms that will be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms.
To create a bi-directional expansion specify an expanded_terms array. When found in a query, all items in the expanded_terms array are then expanded to the other items in the same array.
To create a uni-directional expansion, specify both an array of input_terms and an array of expanded_terms. When items in the input_terms array are present in a query, they are expanded using the items listed in the expanded_terms array.
- expansions
A list of terms that will be expanded for this expansion. If specified, only the items in this list are expanded.
A list of terms that this expansion will be expanded to. If specified without input_terms, it also functions as the input term list.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
An array of query expansion definitions.
Each object in the expansions array represents a term or set of terms that will be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms.
To create a bi-directional expansion specify an expanded_terms array. When found in a query, all items in the expanded_terms array are then expanded to the other items in the same array.
To create a uni-directional expansion, specify both an array of input_terms and an array of expanded_terms. When items in the input_terms array are present in a query, they are expanded using the items listed in the expanded_terms array.
- expansions
A list of terms that will be expanded for this expansion. If specified, only the items in this list are expanded.
A list of terms that this expansion will be expanded to. If specified without input_terms, it also functions as the input term list.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
An array of query expansion definitions.
Each object in the expansions array represents a term or set of terms that will be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms.
To create a bi-directional expansion specify an expanded_terms array. When found in a query, all items in the expanded_terms array are then expanded to the other items in the same array.
To create a uni-directional expansion, specify both an array of input_terms and an array of expanded_terms. When items in the input_terms array are present in a query, they are expanded using the items listed in the expanded_terms array.
- expansions
A list of terms that will be expanded for this expansion. If specified, only the items in this list are expanded.
A list of terms that this expansion will be expanded to. If specified without input_terms, it also functions as the input term list.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
An array of query expansion definitions.
Each object in the expansions array represents a term or set of terms that will be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms.
To create a bi-directional expansion specify an expanded_terms array. When found in a query, all items in the expanded_terms array are then expanded to the other items in the same array.
To create a uni-directional expansion, specify both an array of input_terms and an array of expanded_terms. When items in the input_terms array are present in a query, they are expanded using the items listed in the expanded_terms array.
- expansions
A list of terms that will be expanded for this expansion. If specified, only the items in this list are expanded.
A list of terms that this expansion will be expanded to. If specified without input_terms, it also functions as the input term list.
curl -X POST -u "apikey":"{apikey}" -H "Content-Type: application/json" -d @expansions.json "{url}/v1/environments/{environment_id}/collections/{collection_id}/expansions?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var expansions = new List<Expansion>() { new Expansion() { InputTerms = new List<string>() { "input-term" }, ExpandedTerms = new List<string>() { "expanded-term" } } }; var result = discovery.CreateExpansions( environmentId: "{environmentId}", collectionId: "{collectionId}", expansions: expansions ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; List<String> expansion1InputTerms = Arrays.asList("weekday", "week day"); List<String> expansion1ExpandedTerms = Arrays.asList("monday", "tuesday", "wednesday", "thursday", "friday"); List<String> expansion2InputTerms = Arrays.asList("weekend", "week end"); List<String> expansion2ExpandedTerms = Arrays.asList("saturday", "sunday"); Expansion expansion1 = new Expansion(); expansion1.setInputTerms(expansion1InputTerms); expansion1.setExpandedTerms(expansion1ExpandedTerms); Expansion expansion2 = new Expansion(); expansion2.setInputTerms(expansion2InputTerms); expansion2.setExpandedTerms(expansion2ExpandedTerms); Expansions expansions = new Expansions(); expansions.setExpansions(Arrays.asList(expansion1, expansion2)); CreateExpansionsOptions createOptions = new CreateExpansionsOptions.Builder() .environmentId(environmentId) .collectionId(collectionId) .expansions(expansions) .build(); Expansions createResults = discovery.createExpansions(createOptions).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const createExpansionsParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', expansions: [{ expanded_terms: ['{expanded term}'], }], }; discovery.createExpansions(createExpansionsParams) .then(expansions => { console.log(JSON.stringify(expansions, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
The query expansion definitions for the specified collection.
An array of query expansion definitions.
Each object in the expansions array represents a term or set of terms that will be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms.
To create a bi-directional expansion specify an expanded_terms array. When found in a query, all items in the expanded_terms array are then expanded to the other items in the same array.
To create a uni-directional expansion, specify both an array of input_terms and an array of expanded_terms. When items in the input_terms array are present in a query, they are expanded using the items listed in the expanded_terms array.
The query expansion definitions for the specified collection.
An array of query expansion definitions.
Each object in the expansions array represents a term or set of terms that will be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms.
To create a bi-directional expansion specify an expanded_terms array. When found in a query, all items in the expanded_terms array are then expanded to the other items in the same array.
To create a uni-directional expansion, specify both an array of input_terms and an array of expanded_terms. When items in the input_terms array are present in a query, they are expanded using the items listed in the expanded_terms array.
- expansions
A list of terms that will be expanded for this expansion. If specified, only the items in this list are expanded.
A list of terms that this expansion will be expanded to. If specified without input_terms, it also functions as the input term list.
The query expansion definitions for the specified collection.
An array of query expansion definitions.
Each object in the expansions array represents a term or set of terms that will be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms.
To create a bi-directional expansion specify an expanded_terms array. When found in a query, all items in the expanded_terms array are then expanded to the other items in the same array.
To create a uni-directional expansion, specify both an array of input_terms and an array of expanded_terms. When items in the input_terms array are present in a query, they are expanded using the items listed in the expanded_terms array.
- expansions
A list of terms that will be expanded for this expansion. If specified, only the items in this list are expanded.
A list of terms that this expansion will be expanded to. If specified without input_terms, it also functions as the input term list.
The query expansion definitions for the specified collection.
An array of query expansion definitions.
Each object in the expansions array represents a term or set of terms that will be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms.
To create a bi-directional expansion specify an expanded_terms array. When found in a query, all items in the expanded_terms array are then expanded to the other items in the same array.
To create a uni-directional expansion, specify both an array of input_terms and an array of expanded_terms. When items in the input_terms array are present in a query, they are expanded using the items listed in the expanded_terms array.
- expansions
A list of terms that will be expanded for this expansion. If specified, only the items in this list are expanded.
A list of terms that this expansion will be expanded to. If specified without input_terms, it also functions as the input term list.
The query expansion definitions for the specified collection.
An array of query expansion definitions.
Each object in the expansions array represents a term or set of terms that will be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms.
To create a bi-directional expansion specify an expanded_terms array. When found in a query, all items in the expanded_terms array are then expanded to the other items in the same array.
To create a uni-directional expansion, specify both an array of input_terms and an array of expanded_terms. When items in the input_terms array are present in a query, they are expanded using the items listed in the expanded_terms array.
- _Expansions
A list of terms that will be expanded for this expansion. If specified, only the items in this list are expanded.
A list of terms that this expansion will be expanded to. If specified without input_terms, it also functions as the input term list.
Status Code
The expansion list has been accepted and it will used for all future queries
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
Timeout when uploading the expansion list.
No Sample Response
Delete the expansion list
Remove the expansion information for this collection. The expansion list must be deleted to disable query expansion for a collection.
Remove the expansion information for this collection. The expansion list must be deleted to disable query expansion for a collection.
Remove the expansion information for this collection. The expansion list must be deleted to disable query expansion for a collection.
Remove the expansion information for this collection. The expansion list must be deleted to disable query expansion for a collection.
Remove the expansion information for this collection. The expansion list must be deleted to disable query expansion for a collection.
DELETE /v1/environments/{environment_id}/collections/{collection_id}/expansions
ServiceCall<Void> deleteExpansions(DeleteExpansionsOptions deleteExpansionsOptions)
deleteExpansions(params)
delete_expansions(
self,
environment_id: str,
collection_id: str,
**kwargs,
) -> DetailedResponse
DeleteExpansions(string environmentId, string collectionId)
Request
Use the DeleteExpansionsOptions.Builder
to create a DeleteExpansionsOptions
object that contains the parameter values for the deleteExpansions
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The deleteExpansions options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -X DELETE -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/expansions?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.DeleteExpansions( environmentId: "{environmentId}", collectionId: "{collectionId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; DeleteExpansionsOptions deleteOptions = new DeleteExpansionsOptions.Builder() .environmentId(environmentId) .collectionId(collectionId) .build(); discovery.deleteExpansions(deleteOptions).execute();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const deleteExpansionsParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', expansions: [{ expanded_terms: ['{expanded term}'], }], }; discovery.deleteExpansions(deleteExpansionsParams) .then(result => { console.log(JSON.stringify(result, null, 2)); }) .catch(err => { console.log('error:', err); });
Get tokenization dictionary status
Returns the current status of the tokenization dictionary for the specified collection.
Returns the current status of the tokenization dictionary for the specified collection.
Returns the current status of the tokenization dictionary for the specified collection.
Returns the current status of the tokenization dictionary for the specified collection.
Returns the current status of the tokenization dictionary for the specified collection.
GET /v1/environments/{environment_id}/collections/{collection_id}/word_lists/tokenization_dictionary
ServiceCall<TokenDictStatusResponse> getTokenizationDictionaryStatus(GetTokenizationDictionaryStatusOptions getTokenizationDictionaryStatusOptions)
getTokenizationDictionaryStatus(params)
get_tokenization_dictionary_status(
self,
environment_id: str,
collection_id: str,
**kwargs,
) -> DetailedResponse
GetTokenizationDictionaryStatus(string environmentId, string collectionId)
Request
Use the GetTokenizationDictionaryStatusOptions.Builder
to create a GetTokenizationDictionaryStatusOptions
object that contains the parameter values for the getTokenizationDictionaryStatus
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The getTokenizationDictionaryStatus options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -u "apikey":"{apikey}" -X GET "{url}/v1/environments/{environment_id}/collections/{collection_id}/word_lists/tokenization_dictionary?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.GetTokenizationDictionaryStatus( environmentId: "{environmentId}", collectionId: "{collectionId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; GetTokenizationDictionaryStatusOptions getOptions = new GetTokenizationDictionaryStatusOptions.Builder() .environmentId(environmentId) .collectionId(collectionId) .build(); TokenDictStatusResponse response = discovery.getTokenizationDictionaryStatus(getOptions).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const getTokenizationDictionaryStatusParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', }; discovery.getTokenizationDictionaryStatus(getTokenizationDictionaryStatusParams) .then(tokenDictStatusResponse => { console.log(JSON.stringify(tokenDictStatusResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Object describing the current status of the wordlist.
Current wordlist status for the specified collection.
Possible values: [
active
,pending
,not found
]The type for this wordlist. Can be
tokenization_dictionary
orstopwords
.
Object describing the current status of the wordlist.
{
"status": "pending",
"type": "tokenization_dictionary"
}
Current wordlist status for the specified collection.
Possible values: [
active
,pending
,not found
]The type for this wordlist. Can be
tokenization_dictionary
orstopwords
.
Object describing the current status of the wordlist.
{
"status": "pending",
"type": "tokenization_dictionary"
}
Current wordlist status for the specified collection.
Possible values: [
active
,pending
,not found
]The type for this wordlist. Can be
tokenization_dictionary
orstopwords
.
Object describing the current status of the wordlist.
{
"status": "pending",
"type": "tokenization_dictionary"
}
Current wordlist status for the specified collection.
Possible values: [
active
,pending
,not found
]The type for this wordlist. Can be
tokenization_dictionary
orstopwords
.
Object describing the current status of the wordlist.
{
"status": "pending",
"type": "tokenization_dictionary"
}
Current wordlist status for the specified collection.
Possible values: [
active
,pending
,not found
]The type for this wordlist. Can be
tokenization_dictionary
orstopwords
.
Status Code
Tokenization dictionary found and is pending or active.
Tokenization dictionary for this collection not found.
Unexpected error, try again.
{ "status": "pending", "type": "tokenization_dictionary" }
{ "status": "pending", "type": "tokenization_dictionary" }
{ "status": "pending", "type": "tokenization_dictionary" }
{ "status": "pending", "type": "tokenization_dictionary" }
Create tokenization dictionary
Upload a custom tokenization dictionary to use with the specified collection.
Upload a custom tokenization dictionary to use with the specified collection.
Upload a custom tokenization dictionary to use with the specified collection.
Upload a custom tokenization dictionary to use with the specified collection.
Upload a custom tokenization dictionary to use with the specified collection.
POST /v1/environments/{environment_id}/collections/{collection_id}/word_lists/tokenization_dictionary
ServiceCall<TokenDictStatusResponse> createTokenizationDictionary(CreateTokenizationDictionaryOptions createTokenizationDictionaryOptions)
createTokenizationDictionary(params)
create_tokenization_dictionary(
self,
environment_id: str,
collection_id: str,
*,
tokenization_rules: List['TokenDictRule'] = None,
**kwargs,
) -> DetailedResponse
CreateTokenizationDictionary(string environmentId, string collectionId, List<TokenDictRule> tokenizationRules = null)
Request
Use the CreateTokenizationDictionaryOptions.Builder
to create a CreateTokenizationDictionaryOptions
object that contains the parameter values for the createTokenizationDictionary
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
An object that represents the tokenization dictionary to be uploaded.
{
"tokenization_rules": [
{
"text": "すしネコ",
"tokens": [
"すし",
"ネコ"
],
"readings": [
"寿司",
"ネコ"
],
"part_of_speech": "カスタム名詞"
}
]
}
An array of tokenization rules. Each rule contains, the original
text
string, componenttokens
, any alternate character setreadings
, and whichpart_of_speech
the text is from.
The createTokenizationDictionary options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
An array of tokenization rules. Each rule contains, the original
text
string, componenttokens
, any alternate character setreadings
, and whichpart_of_speech
the text is from.- tokenizationRules
The string to tokenize.
Array of tokens that the
text
field is split into when found.Array of tokens that represent the content of the
text
field in an alternate character set.The part of speech that the
text
string belongs to. For examplenoun
. Custom parts of speech can be specified.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
An array of tokenization rules. Each rule contains, the original
text
string, componenttokens
, any alternate character setreadings
, and whichpart_of_speech
the text is from.- tokenizationRules
The string to tokenize.
Array of tokens that the
text
field is split into when found.Array of tokens that represent the content of the
text
field in an alternate character set.The part of speech that the
text
string belongs to. For examplenoun
. Custom parts of speech can be specified.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
An array of tokenization rules. Each rule contains, the original
text
string, componenttokens
, any alternate character setreadings
, and whichpart_of_speech
the text is from.- tokenization_rules
The string to tokenize.
Array of tokens that the
text
field is split into when found.Array of tokens that represent the content of the
text
field in an alternate character set.The part of speech that the
text
string belongs to. For examplenoun
. Custom parts of speech can be specified.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
An array of tokenization rules. Each rule contains, the original
text
string, componenttokens
, any alternate character setreadings
, and whichpart_of_speech
the text is from.- tokenizationRules
The string to tokenize.
Array of tokens that the
text
field is split into when found.Array of tokens that represent the content of the
text
field in an alternate character set.The part of speech that the
text
string belongs to. For examplenoun
. Custom parts of speech can be specified.
curl -u "apikey":"{apikey}" -X POST -H "Content-Type: application/json" -d @tokendict.json "{url}/v1/environments/{environment_id}/collections/{collection_id}/word_lists/tokenization_dictionary?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var tokenizationRules = new List<TokenDictRule>() { new TokenDictRule() { Text = "すしネコ", Tokens = new List<string>() { "すし", "ネコ" }, Readings = new List<string>() { "寿司", "ネコ" }, PartOfSpeech = "カスタム名詞" } }; var result = discovery.CreateTokenizationDictionary( environmentId: "{environmentId}", collectionId: "{collectionId}", tokenizationRules: tokenizationRules ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; TokenDictRule tokenDictRule = new TokenDictRule(); tokenDictRule.setText("token"); tokenDictRule.setPartOfSpeech("noun"); tokenDictRule.setReadings(Arrays.asList("reading 1", "reading 2")); tokenDictRule.setTokens(Arrays.asList("token 1", "token 2")); CreateTokenizationDictionaryOptions createOptions = new CreateTokenizationDictionaryOptions.Builder() .environmentId(environmentId) .collectionId(collectionId) .addTokenizationRules(tokenDictRule) .build(); TokenDictStatusResponse response = discovery.createTokenizationDictionary(createOptions).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const createTokenizationDictionaryParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', tokenizationRules: [ { text: 'すしネコ', tokens: ['すし', 'ネコ'], readings: ['寿司', 'ネコ'], part_of_speech: 'カスタム名詞', }, ], }; discovery.createTokenizationDictionary(createTokenizationDictionaryParams) .then(tokenDictStatusResponse => { console.log(JSON.stringify(tokenDictStatusResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Object describing the current status of the wordlist.
Current wordlist status for the specified collection.
Possible values: [
active
,pending
,not found
]The type for this wordlist. Can be
tokenization_dictionary
orstopwords
.
Object describing the current status of the wordlist.
{
"status": "pending",
"type": "tokenization_dictionary"
}
Current wordlist status for the specified collection.
Possible values: [
active
,pending
,not found
]The type for this wordlist. Can be
tokenization_dictionary
orstopwords
.
Object describing the current status of the wordlist.
{
"status": "pending",
"type": "tokenization_dictionary"
}
Current wordlist status for the specified collection.
Possible values: [
active
,pending
,not found
]The type for this wordlist. Can be
tokenization_dictionary
orstopwords
.
Object describing the current status of the wordlist.
{
"status": "pending",
"type": "tokenization_dictionary"
}
Current wordlist status for the specified collection.
Possible values: [
active
,pending
,not found
]The type for this wordlist. Can be
tokenization_dictionary
orstopwords
.
Object describing the current status of the wordlist.
{
"status": "pending",
"type": "tokenization_dictionary"
}
Current wordlist status for the specified collection.
Possible values: [
active
,pending
,not found
]The type for this wordlist. Can be
tokenization_dictionary
orstopwords
.
Status Code
Uploaded successfully, pending update to the collection.
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
Word list too large
Unexpected error, try again.
{ "status": "pending", "type": "tokenization_dictionary" }
{ "status": "pending", "type": "tokenization_dictionary" }
Delete tokenization dictionary
Delete the tokenization dictionary from the collection.
Delete the tokenization dictionary from the collection.
Delete the tokenization dictionary from the collection.
Delete the tokenization dictionary from the collection.
Delete the tokenization dictionary from the collection.
DELETE /v1/environments/{environment_id}/collections/{collection_id}/word_lists/tokenization_dictionary
ServiceCall<Void> deleteTokenizationDictionary(DeleteTokenizationDictionaryOptions deleteTokenizationDictionaryOptions)
deleteTokenizationDictionary(params)
delete_tokenization_dictionary(
self,
environment_id: str,
collection_id: str,
**kwargs,
) -> DetailedResponse
DeleteTokenizationDictionary(string environmentId, string collectionId)
Request
Use the DeleteTokenizationDictionaryOptions.Builder
to create a DeleteTokenizationDictionaryOptions
object that contains the parameter values for the deleteTokenizationDictionary
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The deleteTokenizationDictionary options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -u "apikey":"{apikey}" -X DELETE "{url}/v1/environments/{environment_id}/collections/{collection_id}/word_lists/tokenization_dictionary?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.DeleteTokenizationDictionary( environmentId: "{environmentId}", collectionId: "{collectionId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; DeleteTokenizationDictionaryOptions deleteOptions = new DeleteTokenizationDictionaryOptions.Builder() .environmentId(environmentId) .collectionId(collectionId) .build(); discovery.deleteTokenizationDictionary(deleteOptions).execute();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const deleteTokenizationDictionaryParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', }; discovery.deleteTokenizationDictionary(deleteTokenizationDictionaryParams) .then(result => { console.log(JSON.stringify(result, null, 2)); }) .catch(err => { console.log('error:', err); });
Get stopword list status
Returns the current status of the stopword list for the specified collection.
Returns the current status of the stopword list for the specified collection.
Returns the current status of the stopword list for the specified collection.
Returns the current status of the stopword list for the specified collection.
Returns the current status of the stopword list for the specified collection.
GET /v1/environments/{environment_id}/collections/{collection_id}/word_lists/stopwords
ServiceCall<TokenDictStatusResponse> getStopwordListStatus(GetStopwordListStatusOptions getStopwordListStatusOptions)
getStopwordListStatus(params)
get_stopword_list_status(
self,
environment_id: str,
collection_id: str,
**kwargs,
) -> DetailedResponse
GetStopwordListStatus(string environmentId, string collectionId)
Request
Use the GetStopwordListStatusOptions.Builder
to create a GetStopwordListStatusOptions
object that contains the parameter values for the getStopwordListStatus
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The getStopwordListStatus options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -u "apikey":"{apikey}" -X GET "{url}/v1/environments/{environment_id}/collections/{collection_id}/word_lists/stopwords?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.GetStopwordListStatus( environmentId: "{environmentId}", collectionId: "{collectionId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; GetStopwordListStatusOptions options = new GetStopwordListStatusOptions.Builder() .environmentId(environmentId) .collectionId(collectionId) .build(); TokenDictStatusResponse response = discovery.getStopwordListStatus(options).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const getStopwordListStatusParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', }; discovery.getStopwordListStatus(getStopwordListStatusParams) .then(tokenDictStatusResponse => { console.log(JSON.stringify(tokenDictStatusResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Object describing the current status of the wordlist.
Current wordlist status for the specified collection.
Possible values: [
active
,pending
,not found
]The type for this wordlist. Can be
tokenization_dictionary
orstopwords
.
Object describing the current status of the wordlist.
{
"status": "pending",
"type": "tokenization_dictionary"
}
Current wordlist status for the specified collection.
Possible values: [
active
,pending
,not found
]The type for this wordlist. Can be
tokenization_dictionary
orstopwords
.
Object describing the current status of the wordlist.
{
"status": "pending",
"type": "tokenization_dictionary"
}
Current wordlist status for the specified collection.
Possible values: [
active
,pending
,not found
]The type for this wordlist. Can be
tokenization_dictionary
orstopwords
.
Object describing the current status of the wordlist.
{
"status": "pending",
"type": "tokenization_dictionary"
}
Current wordlist status for the specified collection.
Possible values: [
active
,pending
,not found
]The type for this wordlist. Can be
tokenization_dictionary
orstopwords
.
Object describing the current status of the wordlist.
{
"status": "pending",
"type": "tokenization_dictionary"
}
Current wordlist status for the specified collection.
Possible values: [
active
,pending
,not found
]The type for this wordlist. Can be
tokenization_dictionary
orstopwords
.
Status Code
Stopword list found and is pending or active.
Stopword list for this collection not found.
Unexpected error, try again.
{ "status": "pending", "type": "tokenization_dictionary" }
{ "status": "pending", "type": "tokenization_dictionary" }
{ "status": "pending", "type": "tokenization_dictionary" }
{ "status": "pending", "type": "tokenization_dictionary" }
Create stopword list
Upload a custom stopword list to use with the specified collection.
Upload a custom stopword list to use with the specified collection.
Upload a custom stopword list to use with the specified collection.
Upload a custom stopword list to use with the specified collection.
Upload a custom stopword list to use with the specified collection.
POST /v1/environments/{environment_id}/collections/{collection_id}/word_lists/stopwords
ServiceCall<TokenDictStatusResponse> createStopwordList(CreateStopwordListOptions createStopwordListOptions)
createStopwordList(params)
create_stopword_list(
self,
environment_id: str,
collection_id: str,
stopword_file: BinaryIO,
*,
stopword_filename: str = None,
**kwargs,
) -> DetailedResponse
CreateStopwordList(string environmentId, string collectionId, System.IO.MemoryStream stopwordFile, string stopwordFilename)
Request
Use the CreateStopwordListOptions.Builder
to create a CreateStopwordListOptions
object that contains the parameter values for the createStopwordList
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
Form Parameters
The content of the stopword list to ingest.
The createStopwordList options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The content of the stopword list to ingest.
The filename for stopwordFile.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The content of the stopword list to ingest.
The filename for stopwordFile.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The content of the stopword list to ingest.
The filename for stopword_file.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The content of the stopword list to ingest.
The filename for stopwordFile.
curl -u "apikey":"{apikey}" -X POST --data-binary @stopwords.txt "{url}/v1/environments/{environment_id}/collections/{collection_id}/word_lists/stopwords?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); DetailedResponse<TokenDictStatusResponse> result; using (FileStream fs = File.OpenRead("{filepath}")) { using (MemoryStream ms = new MemoryStream()) { fs.CopyTo(ms); result = discovery.CreateStopwordList( environmentId: "{environmentId}", collectionId: "{collectionId}", stopwordFile: ms, stopwordFilename: "{filepath}" ); } } Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; File stopwordFile = new File("{path_to_file}"); String stopwordFilename = "stopword_file"; CreateStopwordListOptions options = new CreateStopwordListOptions.Builder() .environmentId(environmentId) .collectionId(collectionId) .stopwordFile(stopwordFile) .stopwordFilename(stopwordFilename) .build(); TokenDictStatusResponse response = discovery.createStopwordList(options).execute().getResult();
const fs = require('fs'); const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const createStopwordListParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', stopwordFile: fs.createReadStream('./stopwords.txt'), stopwordFilename: 'stopwords.txt', }; discovery.createStopwordList(createStopwordListParams) .then(tokenDictStatusResponse => { console.log(JSON.stringify(tokenDictStatusResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Object describing the current status of the wordlist.
Current wordlist status for the specified collection.
Possible values: [
active
,pending
,not found
]The type for this wordlist. Can be
tokenization_dictionary
orstopwords
.
Object describing the current status of the wordlist.
{
"status": "pending",
"type": "tokenization_dictionary"
}
Current wordlist status for the specified collection.
Possible values: [
active
,pending
,not found
]The type for this wordlist. Can be
tokenization_dictionary
orstopwords
.
Object describing the current status of the wordlist.
{
"status": "pending",
"type": "tokenization_dictionary"
}
Current wordlist status for the specified collection.
Possible values: [
active
,pending
,not found
]The type for this wordlist. Can be
tokenization_dictionary
orstopwords
.
Object describing the current status of the wordlist.
{
"status": "pending",
"type": "tokenization_dictionary"
}
Current wordlist status for the specified collection.
Possible values: [
active
,pending
,not found
]The type for this wordlist. Can be
tokenization_dictionary
orstopwords
.
Object describing the current status of the wordlist.
{
"status": "pending",
"type": "tokenization_dictionary"
}
Current wordlist status for the specified collection.
Possible values: [
active
,pending
,not found
]The type for this wordlist. Can be
tokenization_dictionary
orstopwords
.
Status Code
Stopword list uploaded successfully, pending update to the collection.
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
Word list too large
Unexpected error, try again.
{ "status": "pending", "type": "tokenization_dictionary" }
{ "status": "pending", "type": "tokenization_dictionary" }
Delete a custom stopword list
Delete a custom stopword list from the collection. After a custom stopword list is deleted, the default list is used for the collection.
Delete a custom stopword list from the collection. After a custom stopword list is deleted, the default list is used for the collection.
Delete a custom stopword list from the collection. After a custom stopword list is deleted, the default list is used for the collection.
Delete a custom stopword list from the collection. After a custom stopword list is deleted, the default list is used for the collection.
Delete a custom stopword list from the collection. After a custom stopword list is deleted, the default list is used for the collection.
DELETE /v1/environments/{environment_id}/collections/{collection_id}/word_lists/stopwords
ServiceCall<Void> deleteStopwordList(DeleteStopwordListOptions deleteStopwordListOptions)
deleteStopwordList(params)
delete_stopword_list(
self,
environment_id: str,
collection_id: str,
**kwargs,
) -> DetailedResponse
DeleteStopwordList(string environmentId, string collectionId)
Request
Use the DeleteStopwordListOptions.Builder
to create a DeleteStopwordListOptions
object that contains the parameter values for the deleteStopwordList
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The deleteStopwordList options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -u "apikey":"{apikey}" -X DELETE "{url}/v1/environments/{environment_id}/collections/{collection_id}/word_lists/stopwords?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.DeleteStopwordList( environmentId: "{environmentId}", collectionId: "{collectionId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; DeleteStopwordListOptions options = new DeleteStopwordListOptions.Builder() .environmentId(environmentId) .collectionId(collectionId) .build(); discovery.deleteStopwordList(options).execute();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const deleteStopwordListParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', }; discovery.deleteStopwordList(deleteStopwordListParams) .then(result => { console.log(JSON.stringify(result, null, 2)); }) .catch(err => { console.log('error:', err); });
Add a document
Add a document to a collection with optional metadata.
-
The version query parameter is still required.
-
Returns immediately after the system has accepted the document for processing.
-
The user must provide document content, metadata, or both. If the request is missing both document content and metadata, it is rejected.
-
The user can set the Content-Type parameter on the file part to indicate the media type of the document. If the Content-Type parameter is missing or is one of the generic media types (for example,
application/octet-stream
), then the service attempts to automatically detect the document's media type. -
The following field names are reserved and will be filtered out if present after normalization:
id
,score
,highlight
, and any field with the prefix of:_
,+
, or-
-
Fields with empty name values after normalization are filtered out before indexing.
-
Fields containing the following characters after normalization are filtered out before indexing:
#
and,
Note: Documents can be added with a specific document_id by using the /v1/environments/{environment_id}/collections/{collection_id}/documents method.
Add a document to a collection with optional metadata.
-
The version query parameter is still required.
-
Returns immediately after the system has accepted the document for processing.
-
The user must provide document content, metadata, or both. If the request is missing both document content and metadata, it is rejected.
-
The user can set the Content-Type parameter on the file part to indicate the media type of the document. If the Content-Type parameter is missing or is one of the generic media types (for example,
application/octet-stream
), then the service attempts to automatically detect the document's media type. -
The following field names are reserved and will be filtered out if present after normalization:
id
,score
,highlight
, and any field with the prefix of:_
,+
, or-
-
Fields with empty name values after normalization are filtered out before indexing.
-
Fields containing the following characters after normalization are filtered out before indexing:
#
and,
Note: Documents can be added with a specific document_id by using the _/v1/environments/{environment_id}/collections/{collection_id}/documents method.
Add a document to a collection with optional metadata.
-
The version query parameter is still required.
-
Returns immediately after the system has accepted the document for processing.
-
The user must provide document content, metadata, or both. If the request is missing both document content and metadata, it is rejected.
-
The user can set the Content-Type parameter on the file part to indicate the media type of the document. If the Content-Type parameter is missing or is one of the generic media types (for example,
application/octet-stream
), then the service attempts to automatically detect the document's media type. -
The following field names are reserved and will be filtered out if present after normalization:
id
,score
,highlight
, and any field with the prefix of:_
,+
, or-
-
Fields with empty name values after normalization are filtered out before indexing.
-
Fields containing the following characters after normalization are filtered out before indexing:
#
and,
Note: Documents can be added with a specific document_id by using the _/v1/environments/{environment_id}/collections/{collection_id}/documents method.
Add a document to a collection with optional metadata.
-
The version query parameter is still required.
-
Returns immediately after the system has accepted the document for processing.
-
The user must provide document content, metadata, or both. If the request is missing both document content and metadata, it is rejected.
-
The user can set the Content-Type parameter on the file part to indicate the media type of the document. If the Content-Type parameter is missing or is one of the generic media types (for example,
application/octet-stream
), then the service attempts to automatically detect the document's media type. -
The following field names are reserved and will be filtered out if present after normalization:
id
,score
,highlight
, and any field with the prefix of:_
,+
, or-
-
Fields with empty name values after normalization are filtered out before indexing.
-
Fields containing the following characters after normalization are filtered out before indexing:
#
and,
Note: Documents can be added with a specific document_id by using the /v1/environments/{environment_id}/collections/{collection_id}/documents method.
Add a document to a collection with optional metadata.
-
The version query parameter is still required.
-
Returns immediately after the system has accepted the document for processing.
-
The user must provide document content, metadata, or both. If the request is missing both document content and metadata, it is rejected.
-
The user can set the Content-Type parameter on the file part to indicate the media type of the document. If the Content-Type parameter is missing or is one of the generic media types (for example,
application/octet-stream
), then the service attempts to automatically detect the document's media type. -
The following field names are reserved and will be filtered out if present after normalization:
id
,score
,highlight
, and any field with the prefix of:_
,+
, or-
-
Fields with empty name values after normalization are filtered out before indexing.
-
Fields containing the following characters after normalization are filtered out before indexing:
#
and,
Note: Documents can be added with a specific document_id by using the _/v1/environments/{environment_id}/collections/{collection_id}/documents method.
POST /v1/environments/{environment_id}/collections/{collection_id}/documents
ServiceCall<DocumentAccepted> addDocument(AddDocumentOptions addDocumentOptions)
addDocument(params)
add_document(
self,
environment_id: str,
collection_id: str,
*,
file: BinaryIO = None,
filename: str = None,
file_content_type: str = None,
metadata: str = None,
**kwargs,
) -> DetailedResponse
AddDocument(string environmentId, string collectionId, System.IO.MemoryStream file = null, string filename = null, string fileContentType = null, string metadata = null)
Request
Use the AddDocumentOptions.Builder
to create a AddDocumentOptions
object that contains the parameter values for the addDocument
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
Form Parameters
The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. Files larger than the supported size are rejected.
The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example:
{ "Creator": "Johnny Appleseed", "Subject": "Apples" }
The addDocument options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. Files larger than the supported size are rejected.
The filename for file.
The content type of file. Values for this parameter can be obtained from the HttpMediaType class.
Allowable values: [
application/json
,application/msword
,application/vnd.openxmlformats-officedocument.wordprocessingml.document
,application/pdf
,text/html
,application/xhtml+xml
]The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example:
{ "Creator": "Johnny Appleseed", "Subject": "Apples" }
.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. Files larger than the supported size are rejected.
The filename for file.
The content type of file.
Allowable values: [
application/json
,application/msword
,application/vnd.openxmlformats-officedocument.wordprocessingml.document
,application/pdf
,text/html
,application/xhtml+xml
]The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example:
{ "Creator": "Johnny Appleseed", "Subject": "Apples" }
.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. Files larger than the supported size are rejected.
The filename for file.
The content type of file.
Allowable values: [
application/json
,application/msword
,application/vnd.openxmlformats-officedocument.wordprocessingml.document
,application/pdf
,text/html
,application/xhtml+xml
]The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example:
{ "Creator": "Johnny Appleseed", "Subject": "Apples" }
.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. Files larger than the supported size are rejected.
The filename for file.
The content type of file.
Allowable values: [
application/json
,application/msword
,application/vnd.openxmlformats-officedocument.wordprocessingml.document
,application/pdf
,text/html
,application/xhtml+xml
]The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example:
{ "Creator": "Johnny Appleseed", "Subject": "Apples" }
.
curl -X POST -u "apikey":"{apikey}" -F file=@sample1.html "{url}/v1/environments/{environment_id}/collections/{collection_id}/documents?version=2019-04-30"
Download example document sample1.html
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); DetailedResponse<DocumentAccepted> result; using (FileStream fs = File.OpenRead("{filePath}")) { using (MemoryStream ms = new MemoryStream()) { fs.CopyTo(ms); result = discovery.AddDocument( environmentId: "{environmentId}", collectionId: "{collectionId}", file: ms, filename: "{fileName}", fileContentType: "{fileContentType}", metadata: metadata ); documentId = result.Result.DocumentId; } } Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; InputStream documentStream = new ByteArrayInputStream(documentJson.getBytes()); AddDocumentOptions.Builder builder = new AddDocumentOptions.Builder(environmentId, collectionId); builder.file(documentStream); builder.fileContentType(HttpMediaType.APPLICATION_JSON); DocumentAccepted response = discovery.addDocument(builder.build()).execute().getResult();
Download example document sample1.html
const fs = require('fs'); const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const addDocumentParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', file: fs.createReadStream('./sampleWord.docx'), }; discovery.addDocument(addDocumentParams) .then(documentAccepted => { const documentAccepted = response.result; console.log(JSON.stringify(documentAccepted, null, 2)); }) .catch(err => { console.log('error:', err); });
Download example document sample1.html
import os import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') with open(os.path.join(os.getcwd(), '{path_element}', '{filename}')) as fileinfo: add_doc = discovery.add_document( '{environment_id}', '{collection_id}', file=fileinfo).get_result() print(json.dumps(add_doc, indent=2))
Download example document sample1.html
Response
Information returned after an uploaded document is accepted.
The unique identifier of the ingested document.
Status of the document in the ingestion process. A status of
processing
is returned for documents that are ingested with a version date before2019-01-01
. Thepending
status is returned for all others.Possible values: [
processing
,pending
]Array of notices produced by the document-ingestion process.
Information returned after an uploaded document is accepted.
{
"document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"status": "processing"
}
The unique identifier of the ingested document.
Status of the document in the ingestion process. A status of
processing
is returned for documents that are ingested with a version date before2019-01-01
. Thepending
status is returned for all others.Possible values: [
processing
,pending
]Array of notices produced by the document-ingestion process.
- notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Information returned after an uploaded document is accepted.
{
"document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"status": "processing"
}
The unique identifier of the ingested document.
Status of the document in the ingestion process. A status of
processing
is returned for documents that are ingested with a version date before2019-01-01
. Thepending
status is returned for all others.Possible values: [
processing
,pending
]Array of notices produced by the document-ingestion process.
- notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Information returned after an uploaded document is accepted.
{
"document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"status": "processing"
}
The unique identifier of the ingested document.
Status of the document in the ingestion process. A status of
processing
is returned for documents that are ingested with a version date before2019-01-01
. Thepending
status is returned for all others.Possible values: [
processing
,pending
]Array of notices produced by the document-ingestion process.
- notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Information returned after an uploaded document is accepted.
{
"document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"status": "processing"
}
The unique identifier of the ingested document.
Status of the document in the ingestion process. A status of
processing
is returned for documents that are ingested with a version date before2019-01-01
. Thepending
status is returned for all others.Possible values: [
processing
,pending
]Array of notices produced by the document-ingestion process.
- Notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Status Code
The document has been accepted and will be processed.
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
Forbidden. Returned if you attempt to add a document to a collection in a read-only environment.
{ "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37", "status": "processing" }
{ "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37", "status": "processing" }
Get document details
Fetch status details about a submitted document. Note: this operation does not return the document itself. Instead, it returns only the document's processing status and any notices (warnings or errors) that were generated when the document was ingested. Use the query API to retrieve the actual document content.
Fetch status details about a submitted document. Note: this operation does not return the document itself. Instead, it returns only the document's processing status and any notices (warnings or errors) that were generated when the document was ingested. Use the query API to retrieve the actual document content.
Fetch status details about a submitted document. Note: this operation does not return the document itself. Instead, it returns only the document's processing status and any notices (warnings or errors) that were generated when the document was ingested. Use the query API to retrieve the actual document content.
Fetch status details about a submitted document. Note: this operation does not return the document itself. Instead, it returns only the document's processing status and any notices (warnings or errors) that were generated when the document was ingested. Use the query API to retrieve the actual document content.
Fetch status details about a submitted document. Note: this operation does not return the document itself. Instead, it returns only the document's processing status and any notices (warnings or errors) that were generated when the document was ingested. Use the query API to retrieve the actual document content.
GET /v1/environments/{environment_id}/collections/{collection_id}/documents/{document_id}
ServiceCall<DocumentStatus> getDocumentStatus(GetDocumentStatusOptions getDocumentStatusOptions)
getDocumentStatus(params)
get_document_status(
self,
environment_id: str,
collection_id: str,
document_id: str,
**kwargs,
) -> DetailedResponse
GetDocumentStatus(string environmentId, string collectionId, string documentId)
Request
Use the GetDocumentStatusOptions.Builder
to create a GetDocumentStatusOptions
object that contains the parameter values for the getDocumentStatus
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the document.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The getDocumentStatus options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/documents/{document_id}?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.GetDocumentStatus( environmentId: "{environmentId}", collectionId: "{collectionId}", documentId: "{documentId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; String documentId = "{document_id}"; GetDocumentStatusOptions getOptions = new GetDocumentStatusOptions.Builder(environmentId, collectionId, documentId).build(); DocumentStatus response = discovery.getDocumentStatus(getOptions).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const getDocumentStatusParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', documentId: '{document_id}', }; discovery.getDocumentStatus(getDocumentStatusParams) .then(documentStatus => { console.log(JSON.stringify(documentStatus, null, 2)); }) .catch(err => { console.log('error:', err); });
import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') doc_info = discovery.get_document_status( '{environment_id}', '{collection_id}', '{document_id}').get_result() print(json.dumps(doc_info, indent=2))
Response
Status information about a submitted document.
The unique identifier of the document.
Status of the document in the ingestion process.
Possible values: [
available
,available with notices
,failed
,processing
,pending
]Description of the document status.
Array of notices produced by the document-ingestion process.
The unique identifier for the configuration.
Name of the original source file (if available).
The type of the original source file.
Possible values: [
pdf
,html
,word
,json
]The SHA-1 hash of the original source file (formatted as a hexadecimal string).
Status information about a submitted document.
{
"document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"configuration_id": "e8b9d793-b163-452a-9373-bce07efb510b",
"status": "available with notices",
"status_description": "Document is successfully ingested but was indexed with warnings",
"filename": "instructions.html",
"file_type": "html",
"sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
"notices": [
{
"notice_id": "index_342",
"severity": "warning",
"step": "indexing",
"description": "something bad happened",
"document_id": "f1360220-ea2d-4271-9d62-89a910b13c37"
}
]
}
The unique identifier of the document.
The unique identifier for the configuration.
Status of the document in the ingestion process.
Possible values: [
available
,available with notices
,failed
,processing
,pending
]Description of the document status.
Name of the original source file (if available).
The type of the original source file.
Possible values: [
pdf
,html
,word
,json
]The SHA-1 hash of the original source file (formatted as a hexadecimal string).
Array of notices produced by the document-ingestion process.
- notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Status information about a submitted document.
{
"document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"configuration_id": "e8b9d793-b163-452a-9373-bce07efb510b",
"status": "available with notices",
"status_description": "Document is successfully ingested but was indexed with warnings",
"filename": "instructions.html",
"file_type": "html",
"sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
"notices": [
{
"notice_id": "index_342",
"severity": "warning",
"step": "indexing",
"description": "something bad happened",
"document_id": "f1360220-ea2d-4271-9d62-89a910b13c37"
}
]
}
The unique identifier of the document.
The unique identifier for the configuration.
Status of the document in the ingestion process.
Possible values: [
available
,available with notices
,failed
,processing
,pending
]Description of the document status.
Name of the original source file (if available).
The type of the original source file.
Possible values: [
pdf
,html
,word
,json
]The SHA-1 hash of the original source file (formatted as a hexadecimal string).
Array of notices produced by the document-ingestion process.
- notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Status information about a submitted document.
{
"document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"configuration_id": "e8b9d793-b163-452a-9373-bce07efb510b",
"status": "available with notices",
"status_description": "Document is successfully ingested but was indexed with warnings",
"filename": "instructions.html",
"file_type": "html",
"sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
"notices": [
{
"notice_id": "index_342",
"severity": "warning",
"step": "indexing",
"description": "something bad happened",
"document_id": "f1360220-ea2d-4271-9d62-89a910b13c37"
}
]
}
The unique identifier of the document.
The unique identifier for the configuration.
Status of the document in the ingestion process.
Possible values: [
available
,available with notices
,failed
,processing
,pending
]Description of the document status.
Name of the original source file (if available).
The type of the original source file.
Possible values: [
pdf
,html
,word
,json
]The SHA-1 hash of the original source file (formatted as a hexadecimal string).
Array of notices produced by the document-ingestion process.
- notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Status information about a submitted document.
{
"document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"configuration_id": "e8b9d793-b163-452a-9373-bce07efb510b",
"status": "available with notices",
"status_description": "Document is successfully ingested but was indexed with warnings",
"filename": "instructions.html",
"file_type": "html",
"sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
"notices": [
{
"notice_id": "index_342",
"severity": "warning",
"step": "indexing",
"description": "something bad happened",
"document_id": "f1360220-ea2d-4271-9d62-89a910b13c37"
}
]
}
The unique identifier of the document.
The unique identifier for the configuration.
Status of the document in the ingestion process.
Possible values: [
available
,available with notices
,failed
,processing
,pending
]Description of the document status.
Name of the original source file (if available).
The type of the original source file.
Possible values: [
pdf
,html
,word
,json
]The SHA-1 hash of the original source file (formatted as a hexadecimal string).
Array of notices produced by the document-ingestion process.
- Notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Status Code
Successfully fetched document details.
Bad request.
Forbidden. Returned if you attempt to get the status of a document in a collection in a read-only environment.
{ "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37", "configuration_id": "e8b9d793-b163-452a-9373-bce07efb510b", "status": "available with notices", "status_description": "Document is successfully ingested but was indexed with warnings", "filename": "instructions.html", "file_type": "html", "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3", "notices": [ { "notice_id": "index_342", "severity": "warning", "step": "indexing", "description": "something bad happened", "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37" } ] }
{ "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37", "configuration_id": "e8b9d793-b163-452a-9373-bce07efb510b", "status": "available with notices", "status_description": "Document is successfully ingested but was indexed with warnings", "filename": "instructions.html", "file_type": "html", "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3", "notices": [ { "notice_id": "index_342", "severity": "warning", "step": "indexing", "description": "something bad happened", "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37" } ] }
Update a document
Replace an existing document or add a document with a specified document_id. Starts ingesting a document with optional metadata.
Note: When uploading a new document with this method it automatically replaces any document stored with the same document_id if it exists.
Replace an existing document or add a document with a specified document_id. Starts ingesting a document with optional metadata.
Note: When uploading a new document with this method it automatically replaces any document stored with the same document_id if it exists.
Replace an existing document or add a document with a specified document_id. Starts ingesting a document with optional metadata.
Note: When uploading a new document with this method it automatically replaces any document stored with the same document_id if it exists.
Replace an existing document or add a document with a specified document_id. Starts ingesting a document with optional metadata.
Note: When uploading a new document with this method it automatically replaces any document stored with the same document_id if it exists.
Replace an existing document or add a document with a specified document_id. Starts ingesting a document with optional metadata.
Note: When uploading a new document with this method it automatically replaces any document stored with the same document_id if it exists.
POST /v1/environments/{environment_id}/collections/{collection_id}/documents/{document_id}
ServiceCall<DocumentAccepted> updateDocument(UpdateDocumentOptions updateDocumentOptions)
updateDocument(params)
update_document(
self,
environment_id: str,
collection_id: str,
document_id: str,
*,
file: BinaryIO = None,
filename: str = None,
file_content_type: str = None,
metadata: str = None,
**kwargs,
) -> DetailedResponse
UpdateDocument(string environmentId, string collectionId, string documentId, System.IO.MemoryStream file = null, string filename = null, string fileContentType = null, string metadata = null)
Request
Use the UpdateDocumentOptions.Builder
to create a UpdateDocumentOptions
object that contains the parameter values for the updateDocument
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the document.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
Form Parameters
The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. Files larger than the supported size are rejected.
The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example:
{ "Creator": "Johnny Appleseed", "Subject": "Apples" }
The updateDocument options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. Files larger than the supported size are rejected.
The filename for file.
The content type of file. Values for this parameter can be obtained from the HttpMediaType class.
Allowable values: [
application/json
,application/msword
,application/vnd.openxmlformats-officedocument.wordprocessingml.document
,application/pdf
,text/html
,application/xhtml+xml
]The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example:
{ "Creator": "Johnny Appleseed", "Subject": "Apples" }
.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. Files larger than the supported size are rejected.
The filename for file.
The content type of file.
Allowable values: [
application/json
,application/msword
,application/vnd.openxmlformats-officedocument.wordprocessingml.document
,application/pdf
,text/html
,application/xhtml+xml
]The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example:
{ "Creator": "Johnny Appleseed", "Subject": "Apples" }
.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. Files larger than the supported size are rejected.
The filename for file.
The content type of file.
Allowable values: [
application/json
,application/msword
,application/vnd.openxmlformats-officedocument.wordprocessingml.document
,application/pdf
,text/html
,application/xhtml+xml
]The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example:
{ "Creator": "Johnny Appleseed", "Subject": "Apples" }
.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. Files larger than the supported size are rejected.
The filename for file.
The content type of file.
Allowable values: [
application/json
,application/msword
,application/vnd.openxmlformats-officedocument.wordprocessingml.document
,application/pdf
,text/html
,application/xhtml+xml
]The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example:
{ "Creator": "Johnny Appleseed", "Subject": "Apples" }
.
curl -X POST -u "apikey":"{apikey}" -F "file=@sample1.html;type=text/html" "{url}/v1/environments/{environment_id}/collections/{collection_id}/documents/{document_id}?version=2019-04-30"
Download example document sample1.html
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); DetailedResponse<DocumentAccepted> result; using (FileStream fs = File.OpenRead("{filePath}")) { using (MemoryStream ms = new MemoryStream()) { fs.CopyTo(ms); result = discovery.UpdateDocument( environmentId: "{environmentId}", collectionId: "{collectionId}", documentId: "{documentId}", file: ms, filename: "{fileName}", fileContentType: "{fileContentType}", metadata: metadata ); } } Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; String documentId = "{document_id}"; String updatedDocumentJson = "{\"field\":\"value2\"}"; InputStream updatedDocumentStream = new ByteArrayInputStream(updatedDocumentJson.getBytes()); UpdateDocumentOptions.Builder updateBuilder = new UpdateDocumentOptions.Builder(environmentId, collectionId, documentId); updateBuilder.file(updatedDocumentStream); updateBuilder.fileContentType(HttpMediaType.APPLICATION_JSON); DocumentAccepted updateResponse = discovery.updateDocument(updateBuilder.build()).execute().getResult();
Download example document sample1.html
const fs = require('fs'); const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const updateDocumentParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', documentId: '{document_id}', file: fs.createReadStream('./sampleWord.docx'), filename: 'new-filename.docx', }; discovery.updateDocument(updateDocumentParams) .then(documentAccepted => { console.log(JSON.stringify(documentAccepted, null, 2)); }) .catch(err => { console.log('error:', err); });
import os import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') with open(os.path.join(os.getcwd(), '{path_element}', '{filename}')) as fileinfo: add_doc = discovery.update_document( '{environment_id}', '{collection_id}', '{document_id}', file=fileinfo).get_result() print(json.dumps(add_doc, indent=2))
Download example document sample1.html
Response
Information returned after an uploaded document is accepted.
The unique identifier of the ingested document.
Status of the document in the ingestion process. A status of
processing
is returned for documents that are ingested with a version date before2019-01-01
. Thepending
status is returned for all others.Possible values: [
processing
,pending
]Array of notices produced by the document-ingestion process.
Information returned after an uploaded document is accepted.
{
"document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"status": "processing"
}
The unique identifier of the ingested document.
Status of the document in the ingestion process. A status of
processing
is returned for documents that are ingested with a version date before2019-01-01
. Thepending
status is returned for all others.Possible values: [
processing
,pending
]Array of notices produced by the document-ingestion process.
- notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Information returned after an uploaded document is accepted.
{
"document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"status": "processing"
}
The unique identifier of the ingested document.
Status of the document in the ingestion process. A status of
processing
is returned for documents that are ingested with a version date before2019-01-01
. Thepending
status is returned for all others.Possible values: [
processing
,pending
]Array of notices produced by the document-ingestion process.
- notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Information returned after an uploaded document is accepted.
{
"document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"status": "processing"
}
The unique identifier of the ingested document.
Status of the document in the ingestion process. A status of
processing
is returned for documents that are ingested with a version date before2019-01-01
. Thepending
status is returned for all others.Possible values: [
processing
,pending
]Array of notices produced by the document-ingestion process.
- notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Information returned after an uploaded document is accepted.
{
"document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"status": "processing"
}
The unique identifier of the ingested document.
Status of the document in the ingestion process. A status of
processing
is returned for documents that are ingested with a version date before2019-01-01
. Thepending
status is returned for all others.Possible values: [
processing
,pending
]Array of notices produced by the document-ingestion process.
- Notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Status Code
The document has been accepted and it will be processed.
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
Forbidden. Returned if you attempt to add or update a document in a collection in a read-only environment.
{ "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37", "status": "processing" }
{ "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37", "status": "processing" }
Delete a document
If the given document ID is invalid, or if the document is not found, then the a success response is returned (HTTP status code 200
) with the status set to 'deleted'.
If the given document ID is invalid, or if the document is not found, then the a success response is returned (HTTP status code 200
) with the status set to 'deleted'.
If the given document ID is invalid, or if the document is not found, then the a success response is returned (HTTP status code 200
) with the status set to 'deleted'.
If the given document ID is invalid, or if the document is not found, then the a success response is returned (HTTP status code 200
) with the status set to 'deleted'.
If the given document ID is invalid, or if the document is not found, then the a success response is returned (HTTP status code 200
) with the status set to 'deleted'.
DELETE /v1/environments/{environment_id}/collections/{collection_id}/documents/{document_id}
ServiceCall<DeleteDocumentResponse> deleteDocument(DeleteDocumentOptions deleteDocumentOptions)
deleteDocument(params)
delete_document(
self,
environment_id: str,
collection_id: str,
document_id: str,
**kwargs,
) -> DetailedResponse
DeleteDocument(string environmentId, string collectionId, string documentId)
Request
Use the DeleteDocumentOptions.Builder
to create a DeleteDocumentOptions
object that contains the parameter values for the deleteDocument
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the document.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The deleteDocument options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -X DELETE -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/documents/{document_id}?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.DeleteDocument( environmentId: "{environmentId}", collectionId: "{collectionId}", documentId: "{documentId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; String documentId = "{document_id}"; DeleteDocumentOptions deleteRequest = new DeleteDocumentOptions.Builder(environmentId, collectionId, documentId).build(); DeleteDocumentResponse deleteResponse = discovery.deleteDocument(deleteRequest).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const deleteDocumentParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', documentId: '{document_id}', }; discovery.deleteDocument(deleteDocumentParams) .then(deleteDocumentResponse => { console.log(JSON.stringify(deleteDocumentResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') delete_doc = discovery.delete_document('{environment_id}', '{collection_id}', '{document_id}').get_result() print(json.dumps(delete_doc, indent=2))
Response
Information returned when a document is deleted.
The unique identifier of the document.
Status of the document. A deleted document has the status deleted.
Possible values: [
deleted
]
Information returned when a document is deleted.
The unique identifier of the document.
Status of the document. A deleted document has the status deleted.
Possible values: [
deleted
]
Information returned when a document is deleted.
The unique identifier of the document.
Status of the document. A deleted document has the status deleted.
Possible values: [
deleted
]
Information returned when a document is deleted.
The unique identifier of the document.
Status of the document. A deleted document has the status deleted.
Possible values: [
deleted
]
Information returned when a document is deleted.
The unique identifier of the document.
Status of the document. A deleted document has the status deleted.
Possible values: [
deleted
]
Status Code
The document was successfully deleted.
Bad request.
A bad request is returned any time there is a problem with the request itself.
Forbidden. Returned if you attempt to delete a document in a collection in a read-only environment.
No Sample Response
Query a collection (GET)
After your content is uploaded and enriched by Discovery, you can build queries to search your content. For details, see the Discovery documentation.
GET /v1/environments/{environment_id}/collections/{collection_id}/query
Request
Custom Headers
If
true
, queries are not stored in the Discovery Logs endpoint.Default:
false
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
A passages query that returns the most relevant passages from the results.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return. The maximum for the count and offset values together in any one query is 10000
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.
The maximum number of passages to return. The search returns fewer passages if the requested total is not found.
Possible values: value ≤ 100
Default:
10
The approximate number of characters that any one passage will have.
Possible values: 50 ≤ value ≤ 2000
Default:
400
When
true
and used with a Watson Discovery News collection, duplicate results (based on the contents of the title field) are removed. Duplicate comparison is limited to the current query only; offset is not considered. This parameter is currently Beta functionality.Default:
false
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
Field which the returned results will be biased against. The specified field must be either a date or number format. When a date type field is specified returned results are biased towards field values closer to the current date. When a number type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the sort parameter.
curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/query?version=2019-04-30&query=relations.action.lemmatized:acquire&count=15&filter=entities.text:IBM&return=text"
import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') my_query = discovery.query( environment_id='{environment_id}', collection_id='{collection_id}', filter='{filter}', query='{query}', aggregation='{aggregation}', return_fields='{return_fields}' ).get_result() print(json.dumps(my_query, indent=2))
Response
A response containing the documents and aggregations for the query.
The number of matching results for the query.
Array of document results for the query.
- results
Array of aggregation results for the query.
Array of passage results for the query.
The number of duplicate results removed.
The session token for this query. The session token can be used to add events associated with this query to the query and event log.
Important: Session tokens are case sensitive.
An object contain retrieval type information.
The suggestions for a misspelled natural language query.
Status Code
Query executed successfully.
Bad request.
query and natural_language_query can be used in the same request only if training is complete.
Query timed out.
{ "matching_results": 24, "session_token": "1232139230123123123", "retrieval_details": { "document_retrieval_strategy": "untrained" }, "results": [ { "id": "watson-generated ID", "score": 1 } ], "aggregations": { "term": { "results": [ { "key": "active", "matching_results": 34 } ] } } }
Query a collection
By using this method, you can construct long queries. For details, see the Discovery documentation.
By using this method, you can construct long queries. For details, see the Discovery documentation.
By using this method, you can construct long queries. For details, see the Discovery documentation.
By using this method, you can construct long queries. For details, see the Discovery documentation.
By using this method, you can construct long queries. For details, see the Discovery documentation.
POST /v1/environments/{environment_id}/collections/{collection_id}/query
ServiceCall<QueryResponse> query(QueryOptions queryOptions)
query(params)
query(
self,
environment_id: str,
collection_id: str,
*,
filter: str = None,
query: str = None,
natural_language_query: str = None,
passages: bool = None,
aggregation: str = None,
count: int = None,
return_: str = None,
offset: int = None,
sort: str = None,
highlight: bool = None,
passages_fields: str = None,
passages_count: int = None,
passages_characters: int = None,
deduplicate: bool = None,
deduplicate_field: str = None,
similar: bool = None,
similar_document_ids: str = None,
similar_fields: str = None,
bias: str = None,
spelling_suggestions: bool = None,
x_watson_logging_opt_out: bool = None,
**kwargs,
) -> DetailedResponse
Query(string environmentId, string collectionId, string filter = null, string query = null, string naturalLanguageQuery = null, bool? passages = null, string aggregation = null, long? count = null, string _return = null, long? offset = null, string sort = null, bool? highlight = null, string passagesFields = null, long? passagesCount = null, long? passagesCharacters = null, bool? deduplicate = null, string deduplicateField = null, bool? similar = null, string similarDocumentIds = null, string similarFields = null, string bias = null, bool? spellingSuggestions = null, bool? xWatsonLoggingOptOut = null)
Request
Use the QueryOptions.Builder
to create a QueryOptions
object that contains the parameter values for the query
method.
Custom Headers
If
true
, queries are not stored in the Discovery Logs endpoint.Default:
false
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
An object that represents the query to be submitted.
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first. Use a query search when you want to find the most relevant search results.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
A passages query that returns the most relevant passages from the results.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return.
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified. This parameter cannot be used in the same query as the bias parameter.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.
The maximum number of passages to return. The search returns fewer passages if the requested total is not found. The default is
10
. The maximum is100
.Possible values: value ≤ 100
Default:
10
The approximate number of characters that any one passage will have.
Possible values: 50 ≤ value ≤ 2000
Default:
400
When
true
, and used with a Watson Discovery News collection, duplicate results (based on the contents of the title field) are removed. Duplicate comparison is limited to the current query only; offset is not considered. This parameter is currently Beta functionality.Default:
false
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
Field which the returned results will be biased against. The specified field must be either a date or number format. When a date type field is specified returned results are biased towards field values closer to the current date. When a number type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the sort parameter.
When
true
and the natural_language_query parameter is used, the natural_languge_query parameter is spell checked. The most likely correction is returned in the suggested_query field of the response (if one exists).Important: this parameter is only valid when using the Cloud Pak version of Discovery.
Default:
false
The query options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first. Use a query search when you want to find the most relevant search results.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
A passages query that returns the most relevant passages from the results.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return.
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified. This parameter cannot be used in the same query as the bias parameter.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.
The maximum number of passages to return. The search returns fewer passages if the requested total is not found. The default is
10
. The maximum is100
.Possible values: value ≤ 100
Default:
10
The approximate number of characters that any one passage will have.
Possible values: 50 ≤ value ≤ 2000
Default:
400
When
true
, and used with a Watson Discovery News collection, duplicate results (based on the contents of the title field) are removed. Duplicate comparison is limited to the current query only; offset is not considered. This parameter is currently Beta functionality.Default:
false
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
Field which the returned results will be biased against. The specified field must be either a date or number format. When a date type field is specified returned results are biased towards field values closer to the current date. When a number type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the sort parameter.
When
true
and the natural_language_query parameter is used, the natural_languge_query parameter is spell checked. The most likely correction is returned in the suggested_query field of the response (if one exists).Important: this parameter is only valid when using the Cloud Pak version of Discovery.
Default:
false
If
true
, queries are not stored in the Discovery Logs endpoint.Default:
false
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first. Use a query search when you want to find the most relevant search results.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
A passages query that returns the most relevant passages from the results.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return.
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified. This parameter cannot be used in the same query as the bias parameter.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.
The maximum number of passages to return. The search returns fewer passages if the requested total is not found. The default is
10
. The maximum is100
.Possible values: value ≤ 100
Default:
10
The approximate number of characters that any one passage will have.
Possible values: 50 ≤ value ≤ 2000
Default:
400
When
true
, and used with a Watson Discovery News collection, duplicate results (based on the contents of the title field) are removed. Duplicate comparison is limited to the current query only; offset is not considered. This parameter is currently Beta functionality.Default:
false
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
Field which the returned results will be biased against. The specified field must be either a date or number format. When a date type field is specified returned results are biased towards field values closer to the current date. When a number type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the sort parameter.
When
true
and the natural_language_query parameter is used, the natural_languge_query parameter is spell checked. The most likely correction is returned in the suggested_query field of the response (if one exists).Important: this parameter is only valid when using the Cloud Pak version of Discovery.
Default:
false
If
true
, queries are not stored in the Discovery Logs endpoint.Default:
false
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first. Use a query search when you want to find the most relevant search results.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
A passages query that returns the most relevant passages from the results.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return.
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified. This parameter cannot be used in the same query as the bias parameter.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.
The maximum number of passages to return. The search returns fewer passages if the requested total is not found. The default is
10
. The maximum is100
.Possible values: value ≤ 100
Default:
10
The approximate number of characters that any one passage will have.
Possible values: 50 ≤ value ≤ 2000
Default:
400
When
true
, and used with a Watson Discovery News collection, duplicate results (based on the contents of the title field) are removed. Duplicate comparison is limited to the current query only; offset is not considered. This parameter is currently Beta functionality.Default:
false
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
Field which the returned results will be biased against. The specified field must be either a date or number format. When a date type field is specified returned results are biased towards field values closer to the current date. When a number type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the sort parameter.
When
true
and the natural_language_query parameter is used, the natural_languge_query parameter is spell checked. The most likely correction is returned in the suggested_query field of the response (if one exists).Important: this parameter is only valid when using the Cloud Pak version of Discovery.
Default:
false
If
true
, queries are not stored in the Discovery Logs endpoint.Default:
false
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first. Use a query search when you want to find the most relevant search results.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
A passages query that returns the most relevant passages from the results.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return.
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified. This parameter cannot be used in the same query as the bias parameter.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.
The maximum number of passages to return. The search returns fewer passages if the requested total is not found. The default is
10
. The maximum is100
.Possible values: value ≤ 100
Default:
10
The approximate number of characters that any one passage will have.
Possible values: 50 ≤ value ≤ 2000
Default:
400
When
true
, and used with a Watson Discovery News collection, duplicate results (based on the contents of the title field) are removed. Duplicate comparison is limited to the current query only; offset is not considered. This parameter is currently Beta functionality.Default:
false
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
Field which the returned results will be biased against. The specified field must be either a date or number format. When a date type field is specified returned results are biased towards field values closer to the current date. When a number type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the sort parameter.
When
true
and the natural_language_query parameter is used, the natural_languge_query parameter is spell checked. The most likely correction is returned in the suggested_query field of the response (if one exists).Important: this parameter is only valid when using the Cloud Pak version of Discovery.
Default:
false
If
true
, queries are not stored in the Discovery Logs endpoint.Default:
false
curl -u "apikey":"{apikey}" -d '{"query": "relations.action.lemmatized:acquire"}' "{url}/v1/environments/{environment_id}/collections/{collection_id}/query?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.Query( environmentId: "{environmentId}", collectionId: "{collectionId}", filter: "{filter}", query: "{query}", aggregation: "{aggregation}", returnFields: "{return_fields}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId); queryBuilder.query("{field}:{value}"); QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const queryParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', }; discovery.query(queryParams) .then(queryResponse => { console.log(JSON.stringify(queryResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
A response containing the documents and aggregations for the query.
The number of matching results for the query.
Array of document results for the query.
- results
Array of aggregation results for the query.
Array of passage results for the query.
The number of duplicate results removed.
The session token for this query. The session token can be used to add events associated with this query to the query and event log.
Important: Session tokens are case sensitive.
An object contain retrieval type information.
The suggestions for a misspelled natural language query.
A response containing the documents and aggregations for the query.
{
"matching_results": 24,
"session_token": "1232139230123123123",
"retrieval_details": {
"document_retrieval_strategy": "untrained"
},
"results": [
{
"id": "watson-generated ID",
"score": 1
}
],
"aggregations": {
"term": {
"results": [
{
"key": "active",
"matching_results": 34
}
]
}
}
}
The number of matching results for the query.
Array of document results for the query.
- results
The unique identifier of the document.
Metadata of the document.
The collection ID of the collection containing the document for this result.
Metadata of a query result.
- resultMetadata
An unbounded measure of the relevance of a particular result, dependent on the query and matching document. A higher score indicates a greater match to the query parameters.
The confidence score for the given result. Calculated based on how relevant the result is estimated to be. confidence can range from
0.0
to1.0
. The higher the number, the more relevant the document. Theconfidence
value for a result was calculated using the model specified in thedocument_retrieval_strategy
field of the result set.
Array of aggregation results for the query.
- aggregations
The type of aggregation command used. For example: term, filter, max, min, etc.
Array of passage results for the query.
- passages
The unique identifier of the document from which the passage has been extracted.
The confidence score of the passages's analysis. A higher score indicates greater confidence.
The content of the extracted passage.
The position of the first character of the extracted passage in the originating field.
The position of the last character of the extracted passage in the originating field.
The label of the field from which the passage has been extracted.
The number of duplicate results removed.
The session token for this query. The session token can be used to add events associated with this query to the query and event log.
Important: Session tokens are case sensitive.
An object contain retrieval type information.
- retrievalDetails
Indentifies the document retrieval strategy used for this query.
relevancy_training
indicates that the results were returned using a relevancy trained model.continuous_relevancy_training
indicates that the results were returned using the continuous relevancy training model created by result feedback analysis.untrained
means the results were returned using the standard untrained model.Note: In the event of trained collections being queried, but the trained model is not used to return results, the document_retrieval_strategy will be listed as
untrained
.Possible values: [
untrained
,relevancy_training
,continuous_relevancy_training
]
The suggestions for a misspelled natural language query.
A response containing the documents and aggregations for the query.
{
"matching_results": 24,
"session_token": "1232139230123123123",
"retrieval_details": {
"document_retrieval_strategy": "untrained"
},
"results": [
{
"id": "watson-generated ID",
"score": 1
}
],
"aggregations": {
"term": {
"results": [
{
"key": "active",
"matching_results": 34
}
]
}
}
}
The number of matching results for the query.
Array of document results for the query.
- results
The unique identifier of the document.
Metadata of the document.
The collection ID of the collection containing the document for this result.
Metadata of a query result.
- result_metadata
An unbounded measure of the relevance of a particular result, dependent on the query and matching document. A higher score indicates a greater match to the query parameters.
The confidence score for the given result. Calculated based on how relevant the result is estimated to be. confidence can range from
0.0
to1.0
. The higher the number, the more relevant the document. Theconfidence
value for a result was calculated using the model specified in thedocument_retrieval_strategy
field of the result set.
Array of aggregation results for the query.
- aggregations
The type of aggregation command used. For example: term, filter, max, min, etc.
Array of passage results for the query.
- passages
The unique identifier of the document from which the passage has been extracted.
The confidence score of the passages's analysis. A higher score indicates greater confidence.
The content of the extracted passage.
The position of the first character of the extracted passage in the originating field.
The position of the last character of the extracted passage in the originating field.
The label of the field from which the passage has been extracted.
The number of duplicate results removed.
The session token for this query. The session token can be used to add events associated with this query to the query and event log.
Important: Session tokens are case sensitive.
An object contain retrieval type information.
- retrieval_details
Indentifies the document retrieval strategy used for this query.
relevancy_training
indicates that the results were returned using a relevancy trained model.continuous_relevancy_training
indicates that the results were returned using the continuous relevancy training model created by result feedback analysis.untrained
means the results were returned using the standard untrained model.Note: In the event of trained collections being queried, but the trained model is not used to return results, the document_retrieval_strategy will be listed as
untrained
.Possible values: [
untrained
,relevancy_training
,continuous_relevancy_training
]
The suggestions for a misspelled natural language query.
A response containing the documents and aggregations for the query.
{
"matching_results": 24,
"session_token": "1232139230123123123",
"retrieval_details": {
"document_retrieval_strategy": "untrained"
},
"results": [
{
"id": "watson-generated ID",
"score": 1
}
],
"aggregations": {
"term": {
"results": [
{
"key": "active",
"matching_results": 34
}
]
}
}
}
The number of matching results for the query.
Array of document results for the query.
- results
The unique identifier of the document.
Metadata of the document.
The collection ID of the collection containing the document for this result.
Metadata of a query result.
- result_metadata
An unbounded measure of the relevance of a particular result, dependent on the query and matching document. A higher score indicates a greater match to the query parameters.
The confidence score for the given result. Calculated based on how relevant the result is estimated to be. confidence can range from
0.0
to1.0
. The higher the number, the more relevant the document. Theconfidence
value for a result was calculated using the model specified in thedocument_retrieval_strategy
field of the result set.
Array of aggregation results for the query.
- aggregations
The type of aggregation command used. For example: term, filter, max, min, etc.
Array of passage results for the query.
- passages
The unique identifier of the document from which the passage has been extracted.
The confidence score of the passages's analysis. A higher score indicates greater confidence.
The content of the extracted passage.
The position of the first character of the extracted passage in the originating field.
The position of the last character of the extracted passage in the originating field.
The label of the field from which the passage has been extracted.
The number of duplicate results removed.
The session token for this query. The session token can be used to add events associated with this query to the query and event log.
Important: Session tokens are case sensitive.
An object contain retrieval type information.
- retrieval_details
Indentifies the document retrieval strategy used for this query.
relevancy_training
indicates that the results were returned using a relevancy trained model.continuous_relevancy_training
indicates that the results were returned using the continuous relevancy training model created by result feedback analysis.untrained
means the results were returned using the standard untrained model.Note: In the event of trained collections being queried, but the trained model is not used to return results, the document_retrieval_strategy will be listed as
untrained
.Possible values: [
untrained
,relevancy_training
,continuous_relevancy_training
]
The suggestions for a misspelled natural language query.
A response containing the documents and aggregations for the query.
{
"matching_results": 24,
"session_token": "1232139230123123123",
"retrieval_details": {
"document_retrieval_strategy": "untrained"
},
"results": [
{
"id": "watson-generated ID",
"score": 1
}
],
"aggregations": {
"term": {
"results": [
{
"key": "active",
"matching_results": 34
}
]
}
}
}
The number of matching results for the query.
Array of document results for the query.
- Results
The unique identifier of the document.
Metadata of the document.
The collection ID of the collection containing the document for this result.
Metadata of a query result.
- ResultMetadata
An unbounded measure of the relevance of a particular result, dependent on the query and matching document. A higher score indicates a greater match to the query parameters.
The confidence score for the given result. Calculated based on how relevant the result is estimated to be. confidence can range from
0.0
to1.0
. The higher the number, the more relevant the document. Theconfidence
value for a result was calculated using the model specified in thedocument_retrieval_strategy
field of the result set.
Array of aggregation results for the query.
- Aggregations
The type of aggregation command used. For example: term, filter, max, min, etc.
Array of passage results for the query.
- Passages
The unique identifier of the document from which the passage has been extracted.
The confidence score of the passages's analysis. A higher score indicates greater confidence.
The content of the extracted passage.
The position of the first character of the extracted passage in the originating field.
The position of the last character of the extracted passage in the originating field.
The label of the field from which the passage has been extracted.
The number of duplicate results removed.
The session token for this query. The session token can be used to add events associated with this query to the query and event log.
Important: Session tokens are case sensitive.
An object contain retrieval type information.
- RetrievalDetails
Indentifies the document retrieval strategy used for this query.
relevancy_training
indicates that the results were returned using a relevancy trained model.continuous_relevancy_training
indicates that the results were returned using the continuous relevancy training model created by result feedback analysis.untrained
means the results were returned using the standard untrained model.Note: In the event of trained collections being queried, but the trained model is not used to return results, the document_retrieval_strategy will be listed as
untrained
.Possible values: [
untrained
,relevancy_training
,continuous_relevancy_training
]
The suggestions for a misspelled natural language query.
Status Code
Query executed successfully.
Bad request.
query and natural_language_query can be used in the same request only if training is complete.
Query timed out.
{ "matching_results": 24, "session_token": "1232139230123123123", "retrieval_details": { "document_retrieval_strategy": "untrained" }, "results": [ { "id": "watson-generated ID", "score": 1 } ], "aggregations": { "term": { "results": [ { "key": "active", "matching_results": 34 } ] } } }
{ "matching_results": 24, "session_token": "1232139230123123123", "retrieval_details": { "document_retrieval_strategy": "untrained" }, "results": [ { "id": "watson-generated ID", "score": 1 } ], "aggregations": { "term": { "results": [ { "key": "active", "matching_results": 34 } ] } } }
Query system notices
Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the Discovery documentation for more details on the query language.
Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the Discovery documentation for more details on the query language.
Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the Discovery documentation for more details on the query language.
Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the Discovery documentation for more details on the query language.
Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the Discovery documentation for more details on the query language.
GET /v1/environments/{environment_id}/collections/{collection_id}/notices
ServiceCall<QueryNoticesResponse> queryNotices(QueryNoticesOptions queryNoticesOptions)
queryNotices(params)
query_notices(
self,
environment_id: str,
collection_id: str,
*,
filter: str = None,
query: str = None,
natural_language_query: str = None,
passages: bool = None,
aggregation: str = None,
count: int = None,
return_: List[str] = None,
offset: int = None,
sort: List[str] = None,
highlight: bool = None,
passages_fields: List[str] = None,
passages_count: int = None,
passages_characters: int = None,
deduplicate_field: str = None,
similar: bool = None,
similar_document_ids: List[str] = None,
similar_fields: List[str] = None,
**kwargs,
) -> DetailedResponse
QueryNotices(string environmentId, string collectionId, string filter = null, string query = null, string naturalLanguageQuery = null, bool? passages = null, string aggregation = null, long? count = null, List<string> _return = null, long? offset = null, List<string> sort = null, bool? highlight = null, List<string> passagesFields = null, long? passagesCount = null, long? passagesCharacters = null, string deduplicateField = null, bool? similar = null, List<string> similarDocumentIds = null, List<string> similarFields = null)
Request
Use the QueryNoticesOptions.Builder
to create a QueryNoticesOptions
object that contains the parameter values for the queryNotices
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
A passages query that returns the most relevant passages from the results.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return. The maximum for the count and offset values together in any one query is 10000
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.
The maximum number of passages to return. The search returns fewer passages if the requested total is not found.
Possible values: value ≤ 100
Default:
10
The approximate number of characters that any one passage will have.
Possible values: 50 ≤ value ≤ 2000
Default:
400
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
The queryNotices options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
A passages query that returns the most relevant passages from the results.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return. The maximum for the count and offset values together in any one query is 10000.
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.
The maximum number of passages to return. The search returns fewer passages if the requested total is not found.
Possible values: value ≤ 100
Default:
10
The approximate number of characters that any one passage will have.
Possible values: 50 ≤ value ≤ 2000
Default:
400
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
A passages query that returns the most relevant passages from the results.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return. The maximum for the count and offset values together in any one query is 10000.
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.
The maximum number of passages to return. The search returns fewer passages if the requested total is not found.
Possible values: value ≤ 100
Default:
10
The approximate number of characters that any one passage will have.
Possible values: 50 ≤ value ≤ 2000
Default:
400
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
A passages query that returns the most relevant passages from the results.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return. The maximum for the count and offset values together in any one query is 10000.
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.
The maximum number of passages to return. The search returns fewer passages if the requested total is not found.
Possible values: value ≤ 100
Default:
10
The approximate number of characters that any one passage will have.
Possible values: 50 ≤ value ≤ 2000
Default:
400
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
A passages query that returns the most relevant passages from the results.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return. The maximum for the count and offset values together in any one query is 10000.
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.
The maximum number of passages to return. The search returns fewer passages if the requested total is not found.
Possible values: value ≤ 100
Default:
10
The approximate number of characters that any one passage will have.
Possible values: 50 ≤ value ≤ 2000
Default:
400
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/notices?collection_ids={id1},{id2}&version=2019-04-30&filter=entities.text:error"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.QueryNotices( environmentId: "{environmentId}", collectionId: "{collectionId}", query: "{query}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; QueryNoticesOptions queryOptions = new QueryNoticesOptions.Builder(environmentId, collectionId) .query("{field}:{value}") .build(); QueryNoticesResponse response = discovery.queryNotices(queryOptions).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const queryNoticesParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', }; discovery.queryNotices(queryNoticesParams) .then(queryNoticesResponse => { console.log(JSON.stringify(queryNoticesResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Object containing notice query results.
The number of matching results
Array of document results that match the query.
- results
Array of aggregation results that match the query.
Array of passage results that match the query.
The number of duplicates removed from this notices query.
Object containing notice query results.
{
"matching_results": 24,
"results": [
{
"id": "030ba125-29db-43f2-8552-f941ae30a7a8",
"collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"code": 200,
"score": 1,
"filename": "instructions.html",
"file_type": "html",
"sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
"notices": [
{
"notice_id": "xpath_not_found",
"created": "2016-09-20T17:26:17.000Z",
"document_id": "030ba125-29db-43f2-8552-f941ae30a7a8",
"severity": "warning",
"step": "html-to-html",
"description": "The xpath expression \"boom\" was not found."
}
]
}
],
"aggregations": {
"term": {
"results": [
{
"key": "warning",
"matching_results": 34
}
]
}
}
}
The number of matching results.
Array of document results that match the query.
- results
The unique identifier of the document.
Metadata of the document.
The collection ID of the collection containing the document for this result.
Metadata of a query result.
- resultMetadata
An unbounded measure of the relevance of a particular result, dependent on the query and matching document. A higher score indicates a greater match to the query parameters.
The confidence score for the given result. Calculated based on how relevant the result is estimated to be. confidence can range from
0.0
to1.0
. The higher the number, the more relevant the document. Theconfidence
value for a result was calculated using the model specified in thedocument_retrieval_strategy
field of the result set.
The internal status code returned by the ingestion subsystem indicating the overall result of ingesting the source document.
Name of the original source file (if available).
The type of the original source file.
Possible values: [
pdf
,html
,word
,json
]The SHA-1 hash of the original source file (formatted as a hexadecimal string).
Array of notices for the document.
- notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Array of aggregation results that match the query.
- aggregations
The type of aggregation command used. For example: term, filter, max, min, etc.
Array of passage results that match the query.
- passages
The unique identifier of the document from which the passage has been extracted.
The confidence score of the passages's analysis. A higher score indicates greater confidence.
The content of the extracted passage.
The position of the first character of the extracted passage in the originating field.
The position of the last character of the extracted passage in the originating field.
The label of the field from which the passage has been extracted.
The number of duplicates removed from this notices query.
Object containing notice query results.
{
"matching_results": 24,
"results": [
{
"id": "030ba125-29db-43f2-8552-f941ae30a7a8",
"collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"code": 200,
"score": 1,
"filename": "instructions.html",
"file_type": "html",
"sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
"notices": [
{
"notice_id": "xpath_not_found",
"created": "2016-09-20T17:26:17.000Z",
"document_id": "030ba125-29db-43f2-8552-f941ae30a7a8",
"severity": "warning",
"step": "html-to-html",
"description": "The xpath expression \"boom\" was not found."
}
]
}
],
"aggregations": {
"term": {
"results": [
{
"key": "warning",
"matching_results": 34
}
]
}
}
}
The number of matching results.
Array of document results that match the query.
- results
The unique identifier of the document.
Metadata of the document.
The collection ID of the collection containing the document for this result.
Metadata of a query result.
- result_metadata
An unbounded measure of the relevance of a particular result, dependent on the query and matching document. A higher score indicates a greater match to the query parameters.
The confidence score for the given result. Calculated based on how relevant the result is estimated to be. confidence can range from
0.0
to1.0
. The higher the number, the more relevant the document. Theconfidence
value for a result was calculated using the model specified in thedocument_retrieval_strategy
field of the result set.
The internal status code returned by the ingestion subsystem indicating the overall result of ingesting the source document.
Name of the original source file (if available).
The type of the original source file.
Possible values: [
pdf
,html
,word
,json
]The SHA-1 hash of the original source file (formatted as a hexadecimal string).
Array of notices for the document.
- notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Array of aggregation results that match the query.
- aggregations
The type of aggregation command used. For example: term, filter, max, min, etc.
Array of passage results that match the query.
- passages
The unique identifier of the document from which the passage has been extracted.
The confidence score of the passages's analysis. A higher score indicates greater confidence.
The content of the extracted passage.
The position of the first character of the extracted passage in the originating field.
The position of the last character of the extracted passage in the originating field.
The label of the field from which the passage has been extracted.
The number of duplicates removed from this notices query.
Object containing notice query results.
{
"matching_results": 24,
"results": [
{
"id": "030ba125-29db-43f2-8552-f941ae30a7a8",
"collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"code": 200,
"score": 1,
"filename": "instructions.html",
"file_type": "html",
"sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
"notices": [
{
"notice_id": "xpath_not_found",
"created": "2016-09-20T17:26:17.000Z",
"document_id": "030ba125-29db-43f2-8552-f941ae30a7a8",
"severity": "warning",
"step": "html-to-html",
"description": "The xpath expression \"boom\" was not found."
}
]
}
],
"aggregations": {
"term": {
"results": [
{
"key": "warning",
"matching_results": 34
}
]
}
}
}
The number of matching results.
Array of document results that match the query.
- results
The unique identifier of the document.
Metadata of the document.
The collection ID of the collection containing the document for this result.
Metadata of a query result.
- result_metadata
An unbounded measure of the relevance of a particular result, dependent on the query and matching document. A higher score indicates a greater match to the query parameters.
The confidence score for the given result. Calculated based on how relevant the result is estimated to be. confidence can range from
0.0
to1.0
. The higher the number, the more relevant the document. Theconfidence
value for a result was calculated using the model specified in thedocument_retrieval_strategy
field of the result set.
The internal status code returned by the ingestion subsystem indicating the overall result of ingesting the source document.
Name of the original source file (if available).
The type of the original source file.
Possible values: [
pdf
,html
,word
,json
]The SHA-1 hash of the original source file (formatted as a hexadecimal string).
Array of notices for the document.
- notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Array of aggregation results that match the query.
- aggregations
The type of aggregation command used. For example: term, filter, max, min, etc.
Array of passage results that match the query.
- passages
The unique identifier of the document from which the passage has been extracted.
The confidence score of the passages's analysis. A higher score indicates greater confidence.
The content of the extracted passage.
The position of the first character of the extracted passage in the originating field.
The position of the last character of the extracted passage in the originating field.
The label of the field from which the passage has been extracted.
The number of duplicates removed from this notices query.
Object containing notice query results.
{
"matching_results": 24,
"results": [
{
"id": "030ba125-29db-43f2-8552-f941ae30a7a8",
"collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"code": 200,
"score": 1,
"filename": "instructions.html",
"file_type": "html",
"sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
"notices": [
{
"notice_id": "xpath_not_found",
"created": "2016-09-20T17:26:17.000Z",
"document_id": "030ba125-29db-43f2-8552-f941ae30a7a8",
"severity": "warning",
"step": "html-to-html",
"description": "The xpath expression \"boom\" was not found."
}
]
}
],
"aggregations": {
"term": {
"results": [
{
"key": "warning",
"matching_results": 34
}
]
}
}
}
The number of matching results.
Array of document results that match the query.
- Results
The unique identifier of the document.
Metadata of the document.
The collection ID of the collection containing the document for this result.
Metadata of a query result.
- ResultMetadata
An unbounded measure of the relevance of a particular result, dependent on the query and matching document. A higher score indicates a greater match to the query parameters.
The confidence score for the given result. Calculated based on how relevant the result is estimated to be. confidence can range from
0.0
to1.0
. The higher the number, the more relevant the document. Theconfidence
value for a result was calculated using the model specified in thedocument_retrieval_strategy
field of the result set.
The internal status code returned by the ingestion subsystem indicating the overall result of ingesting the source document.
Name of the original source file (if available).
The type of the original source file.
Possible values: [
pdf
,html
,word
,json
]The SHA-1 hash of the original source file (formatted as a hexadecimal string).
Array of notices for the document.
- Notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Array of aggregation results that match the query.
- Aggregations
The type of aggregation command used. For example: term, filter, max, min, etc.
Array of passage results that match the query.
- Passages
The unique identifier of the document from which the passage has been extracted.
The confidence score of the passages's analysis. A higher score indicates greater confidence.
The content of the extracted passage.
The position of the first character of the extracted passage in the originating field.
The position of the last character of the extracted passage in the originating field.
The label of the field from which the passage has been extracted.
The number of duplicates removed from this notices query.
Status Code
Query for notices executed successfully.
Bad request.
{ "matching_results": 24, "results": [ { "id": "030ba125-29db-43f2-8552-f941ae30a7a8", "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37", "code": 200, "score": 1, "filename": "instructions.html", "file_type": "html", "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3", "notices": [ { "notice_id": "xpath_not_found", "created": "2016-09-20T17:26:17.000Z", "document_id": "030ba125-29db-43f2-8552-f941ae30a7a8", "severity": "warning", "step": "html-to-html", "description": "The xpath expression \"boom\" was not found." } ] } ], "aggregations": { "term": { "results": [ { "key": "warning", "matching_results": 34 } ] } } }
{ "matching_results": 24, "results": [ { "id": "030ba125-29db-43f2-8552-f941ae30a7a8", "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37", "code": 200, "score": 1, "filename": "instructions.html", "file_type": "html", "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3", "notices": [ { "notice_id": "xpath_not_found", "created": "2016-09-20T17:26:17.000Z", "document_id": "030ba125-29db-43f2-8552-f941ae30a7a8", "severity": "warning", "step": "html-to-html", "description": "The xpath expression \"boom\" was not found." } ] } ], "aggregations": { "term": { "results": [ { "key": "warning", "matching_results": 34 } ] } } }
Query multiple collections (GET)
See the Discovery documentation for more details.
GET /v1/environments/{environment_id}/query
Request
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.A comma-separated list of collection IDs to be queried against.
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return. The maximum for the count and offset values together in any one query is 10000
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
When
true
and used with a Watson Discovery News collection, duplicate results (based on the contents of the title field) are removed. Duplicate comparison is limited to the current query only; offset is not considered. This parameter is currently Beta functionality.Default:
false
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
A passages query that returns the most relevant passages from the results.
A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.
The maximum number of passages to return. The search returns fewer passages if the requested total is not found.
Possible values: value ≤ 100
Default:
10
The approximate number of characters that any one passage will have.
Possible values: 50 ≤ value ≤ 2000
Default:
400
Field which the returned results will be biased against. The specified field must be either a date or number format. When a date type field is specified returned results are biased towards field values closer to the current date. When a number type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the sort parameter.
curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/query?collection_ids={id1},{id2}&version=2019-04-30&query=relations.action.lemmatized:acquire&count=15&filter=entities.text:IBM&return=text"
Response
A response containing the documents and aggregations for the query.
The number of matching results for the query.
Array of document results for the query.
- results
Array of aggregation results for the query.
Array of passage results for the query.
The number of duplicate results removed.
The session token for this query. The session token can be used to add events associated with this query to the query and event log.
Important: Session tokens are case sensitive.
An object contain retrieval type information.
The suggestions for a misspelled natural language query.
Status Code
Query executed successfully.
Bad request.
query and natural_language_query can be used in the same request only if training is complete.
Query timed out.
{ "matching_results": 24, "session_token": "1232139230123123123", "retrieval_details": { "document_retrieval_strategy": "untrained" }, "results": [ { "id": "watson-generated ID", "score": 1 } ], "aggregations": { "term": { "results": [ { "key": "active", "matching_results": 34 } ] } } }
Query multiple collections
By using this method, you can construct long queries that search multiple collection. For details, see the Discovery documentation.
By using this method, you can construct long queries that search multiple collection. For details, see the Discovery documentation.
By using this method, you can construct long queries that search multiple collection. For details, see the Discovery documentation.
By using this method, you can construct long queries that search multiple collection. For details, see the Discovery documentation.
By using this method, you can construct long queries that search multiple collection. For details, see the Discovery documentation.
POST /v1/environments/{environment_id}/query
ServiceCall<QueryResponse> federatedQuery(FederatedQueryOptions federatedQueryOptions)
federatedQuery(params)
federated_query(
self,
environment_id: str,
collection_ids: str,
*,
filter: str = None,
query: str = None,
natural_language_query: str = None,
passages: bool = None,
aggregation: str = None,
count: int = None,
return_: str = None,
offset: int = None,
sort: str = None,
highlight: bool = None,
passages_fields: str = None,
passages_count: int = None,
passages_characters: int = None,
deduplicate: bool = None,
deduplicate_field: str = None,
similar: bool = None,
similar_document_ids: str = None,
similar_fields: str = None,
bias: str = None,
x_watson_logging_opt_out: bool = None,
**kwargs,
) -> DetailedResponse
FederatedQuery(string environmentId, string collectionIds, string filter = null, string query = null, string naturalLanguageQuery = null, bool? passages = null, string aggregation = null, long? count = null, string _return = null, long? offset = null, string sort = null, bool? highlight = null, string passagesFields = null, long? passagesCount = null, long? passagesCharacters = null, bool? deduplicate = null, string deduplicateField = null, bool? similar = null, string similarDocumentIds = null, string similarFields = null, string bias = null, bool? xWatsonLoggingOptOut = null)
Request
Use the FederatedQueryOptions.Builder
to create a FederatedQueryOptions
object that contains the parameter values for the federatedQuery
method.
Custom Headers
If
true
, queries are not stored in the Discovery Logs endpoint.Default:
false
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
Object that describes a long query.
A comma-separated list of collection IDs to be queried against.
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first. Use a query search when you want to find the most relevant search results.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
A passages query that returns the most relevant passages from the results.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return.
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified. This parameter cannot be used in the same query as the bias parameter.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.
The maximum number of passages to return. The search returns fewer passages if the requested total is not found. The default is
10
. The maximum is100
.Possible values: value ≤ 100
Default:
10
The approximate number of characters that any one passage will have.
Possible values: 50 ≤ value ≤ 2000
Default:
400
When
true
, and used with a Watson Discovery News collection, duplicate results (based on the contents of the title field) are removed. Duplicate comparison is limited to the current query only; offset is not considered. This parameter is currently Beta functionality.Default:
false
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
Field which the returned results will be biased against. The specified field must be either a date or number format. When a date type field is specified returned results are biased towards field values closer to the current date. When a number type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the sort parameter.
The federatedQuery options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
A comma-separated list of collection IDs to be queried against.
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first. Use a query search when you want to find the most relevant search results.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
A passages query that returns the most relevant passages from the results.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return.
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified. This parameter cannot be used in the same query as the bias parameter.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.
The maximum number of passages to return. The search returns fewer passages if the requested total is not found. The default is
10
. The maximum is100
.Possible values: value ≤ 100
Default:
10
The approximate number of characters that any one passage will have.
Possible values: 50 ≤ value ≤ 2000
Default:
400
When
true
, and used with a Watson Discovery News collection, duplicate results (based on the contents of the title field) are removed. Duplicate comparison is limited to the current query only; offset is not considered. This parameter is currently Beta functionality.Default:
false
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
Field which the returned results will be biased against. The specified field must be either a date or number format. When a date type field is specified returned results are biased towards field values closer to the current date. When a number type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the sort parameter.
If
true
, queries are not stored in the Discovery Logs endpoint.Default:
false
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
A comma-separated list of collection IDs to be queried against.
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first. Use a query search when you want to find the most relevant search results.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
A passages query that returns the most relevant passages from the results.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return.
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified. This parameter cannot be used in the same query as the bias parameter.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.
The maximum number of passages to return. The search returns fewer passages if the requested total is not found. The default is
10
. The maximum is100
.Possible values: value ≤ 100
Default:
10
The approximate number of characters that any one passage will have.
Possible values: 50 ≤ value ≤ 2000
Default:
400
When
true
, and used with a Watson Discovery News collection, duplicate results (based on the contents of the title field) are removed. Duplicate comparison is limited to the current query only; offset is not considered. This parameter is currently Beta functionality.Default:
false
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
Field which the returned results will be biased against. The specified field must be either a date or number format. When a date type field is specified returned results are biased towards field values closer to the current date. When a number type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the sort parameter.
If
true
, queries are not stored in the Discovery Logs endpoint.Default:
false
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
A comma-separated list of collection IDs to be queried against.
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first. Use a query search when you want to find the most relevant search results.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
A passages query that returns the most relevant passages from the results.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return.
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified. This parameter cannot be used in the same query as the bias parameter.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.
The maximum number of passages to return. The search returns fewer passages if the requested total is not found. The default is
10
. The maximum is100
.Possible values: value ≤ 100
Default:
10
The approximate number of characters that any one passage will have.
Possible values: 50 ≤ value ≤ 2000
Default:
400
When
true
, and used with a Watson Discovery News collection, duplicate results (based on the contents of the title field) are removed. Duplicate comparison is limited to the current query only; offset is not considered. This parameter is currently Beta functionality.Default:
false
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
Field which the returned results will be biased against. The specified field must be either a date or number format. When a date type field is specified returned results are biased towards field values closer to the current date. When a number type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the sort parameter.
If
true
, queries are not stored in the Discovery Logs endpoint.Default:
false
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
A comma-separated list of collection IDs to be queried against.
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first. Use a query search when you want to find the most relevant search results.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
A passages query that returns the most relevant passages from the results.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return.
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified. This parameter cannot be used in the same query as the bias parameter.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.
The maximum number of passages to return. The search returns fewer passages if the requested total is not found. The default is
10
. The maximum is100
.Possible values: value ≤ 100
Default:
10
The approximate number of characters that any one passage will have.
Possible values: 50 ≤ value ≤ 2000
Default:
400
When
true
, and used with a Watson Discovery News collection, duplicate results (based on the contents of the title field) are removed. Duplicate comparison is limited to the current query only; offset is not considered. This parameter is currently Beta functionality.Default:
false
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
Field which the returned results will be biased against. The specified field must be either a date or number format. When a date type field is specified returned results are biased towards field values closer to the current date. When a number type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the sort parameter.
If
true
, queries are not stored in the Discovery Logs endpoint.Default:
false
curl -u "apikey":"{apikey}" -d '{"query": "relations.action.lemmatized:acquire"}' "{url}/v1/environments/{environment_id}/query?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.FederatedQuery( environmentId: "{environmentId}", naturalLanguageQuery: "{naturalLanguageQuery}", returnFields: "{returnFields}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; FederatedQueryOptions.Builder options = new FederatedQueryOptions.Builder(environmentId) .query("{field}:{value}") .build(); QueryResponse response = discovery.federatedQuery(options).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const federatedQueryParams = { environmentId: '{environment_id}', collectionIds: '{comma separated collection ids}', }; discovery.federatedQuery(federatedQueryParams) .then(queryResponse => { console.log(JSON.stringify(queryResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
A response containing the documents and aggregations for the query.
The number of matching results for the query.
Array of document results for the query.
- results
Array of aggregation results for the query.
Array of passage results for the query.
The number of duplicate results removed.
The session token for this query. The session token can be used to add events associated with this query to the query and event log.
Important: Session tokens are case sensitive.
An object contain retrieval type information.
The suggestions for a misspelled natural language query.
A response containing the documents and aggregations for the query.
{
"matching_results": 24,
"session_token": "1232139230123123123",
"retrieval_details": {
"document_retrieval_strategy": "untrained"
},
"results": [
{
"id": "watson-generated ID",
"score": 1
}
],
"aggregations": {
"term": {
"results": [
{
"key": "active",
"matching_results": 34
}
]
}
}
}
The number of matching results for the query.
Array of document results for the query.
- results
The unique identifier of the document.
Metadata of the document.
The collection ID of the collection containing the document for this result.
Metadata of a query result.
- resultMetadata
An unbounded measure of the relevance of a particular result, dependent on the query and matching document. A higher score indicates a greater match to the query parameters.
The confidence score for the given result. Calculated based on how relevant the result is estimated to be. confidence can range from
0.0
to1.0
. The higher the number, the more relevant the document. Theconfidence
value for a result was calculated using the model specified in thedocument_retrieval_strategy
field of the result set.
Array of aggregation results for the query.
- aggregations
The type of aggregation command used. For example: term, filter, max, min, etc.
Array of passage results for the query.
- passages
The unique identifier of the document from which the passage has been extracted.
The confidence score of the passages's analysis. A higher score indicates greater confidence.
The content of the extracted passage.
The position of the first character of the extracted passage in the originating field.
The position of the last character of the extracted passage in the originating field.
The label of the field from which the passage has been extracted.
The number of duplicate results removed.
The session token for this query. The session token can be used to add events associated with this query to the query and event log.
Important: Session tokens are case sensitive.
An object contain retrieval type information.
- retrievalDetails
Indentifies the document retrieval strategy used for this query.
relevancy_training
indicates that the results were returned using a relevancy trained model.continuous_relevancy_training
indicates that the results were returned using the continuous relevancy training model created by result feedback analysis.untrained
means the results were returned using the standard untrained model.Note: In the event of trained collections being queried, but the trained model is not used to return results, the document_retrieval_strategy will be listed as
untrained
.Possible values: [
untrained
,relevancy_training
,continuous_relevancy_training
]
The suggestions for a misspelled natural language query.
A response containing the documents and aggregations for the query.
{
"matching_results": 24,
"session_token": "1232139230123123123",
"retrieval_details": {
"document_retrieval_strategy": "untrained"
},
"results": [
{
"id": "watson-generated ID",
"score": 1
}
],
"aggregations": {
"term": {
"results": [
{
"key": "active",
"matching_results": 34
}
]
}
}
}
The number of matching results for the query.
Array of document results for the query.
- results
The unique identifier of the document.
Metadata of the document.
The collection ID of the collection containing the document for this result.
Metadata of a query result.
- result_metadata
An unbounded measure of the relevance of a particular result, dependent on the query and matching document. A higher score indicates a greater match to the query parameters.
The confidence score for the given result. Calculated based on how relevant the result is estimated to be. confidence can range from
0.0
to1.0
. The higher the number, the more relevant the document. Theconfidence
value for a result was calculated using the model specified in thedocument_retrieval_strategy
field of the result set.
Array of aggregation results for the query.
- aggregations
The type of aggregation command used. For example: term, filter, max, min, etc.
Array of passage results for the query.
- passages
The unique identifier of the document from which the passage has been extracted.
The confidence score of the passages's analysis. A higher score indicates greater confidence.
The content of the extracted passage.
The position of the first character of the extracted passage in the originating field.
The position of the last character of the extracted passage in the originating field.
The label of the field from which the passage has been extracted.
The number of duplicate results removed.
The session token for this query. The session token can be used to add events associated with this query to the query and event log.
Important: Session tokens are case sensitive.
An object contain retrieval type information.
- retrieval_details
Indentifies the document retrieval strategy used for this query.
relevancy_training
indicates that the results were returned using a relevancy trained model.continuous_relevancy_training
indicates that the results were returned using the continuous relevancy training model created by result feedback analysis.untrained
means the results were returned using the standard untrained model.Note: In the event of trained collections being queried, but the trained model is not used to return results, the document_retrieval_strategy will be listed as
untrained
.Possible values: [
untrained
,relevancy_training
,continuous_relevancy_training
]
The suggestions for a misspelled natural language query.
A response containing the documents and aggregations for the query.
{
"matching_results": 24,
"session_token": "1232139230123123123",
"retrieval_details": {
"document_retrieval_strategy": "untrained"
},
"results": [
{
"id": "watson-generated ID",
"score": 1
}
],
"aggregations": {
"term": {
"results": [
{
"key": "active",
"matching_results": 34
}
]
}
}
}
The number of matching results for the query.
Array of document results for the query.
- results
The unique identifier of the document.
Metadata of the document.
The collection ID of the collection containing the document for this result.
Metadata of a query result.
- result_metadata
An unbounded measure of the relevance of a particular result, dependent on the query and matching document. A higher score indicates a greater match to the query parameters.
The confidence score for the given result. Calculated based on how relevant the result is estimated to be. confidence can range from
0.0
to1.0
. The higher the number, the more relevant the document. Theconfidence
value for a result was calculated using the model specified in thedocument_retrieval_strategy
field of the result set.
Array of aggregation results for the query.
- aggregations
The type of aggregation command used. For example: term, filter, max, min, etc.
Array of passage results for the query.
- passages
The unique identifier of the document from which the passage has been extracted.
The confidence score of the passages's analysis. A higher score indicates greater confidence.
The content of the extracted passage.
The position of the first character of the extracted passage in the originating field.
The position of the last character of the extracted passage in the originating field.
The label of the field from which the passage has been extracted.
The number of duplicate results removed.
The session token for this query. The session token can be used to add events associated with this query to the query and event log.
Important: Session tokens are case sensitive.
An object contain retrieval type information.
- retrieval_details
Indentifies the document retrieval strategy used for this query.
relevancy_training
indicates that the results were returned using a relevancy trained model.continuous_relevancy_training
indicates that the results were returned using the continuous relevancy training model created by result feedback analysis.untrained
means the results were returned using the standard untrained model.Note: In the event of trained collections being queried, but the trained model is not used to return results, the document_retrieval_strategy will be listed as
untrained
.Possible values: [
untrained
,relevancy_training
,continuous_relevancy_training
]
The suggestions for a misspelled natural language query.
A response containing the documents and aggregations for the query.
{
"matching_results": 24,
"session_token": "1232139230123123123",
"retrieval_details": {
"document_retrieval_strategy": "untrained"
},
"results": [
{
"id": "watson-generated ID",
"score": 1
}
],
"aggregations": {
"term": {
"results": [
{
"key": "active",
"matching_results": 34
}
]
}
}
}
The number of matching results for the query.
Array of document results for the query.
- Results
The unique identifier of the document.
Metadata of the document.
The collection ID of the collection containing the document for this result.
Metadata of a query result.
- ResultMetadata
An unbounded measure of the relevance of a particular result, dependent on the query and matching document. A higher score indicates a greater match to the query parameters.
The confidence score for the given result. Calculated based on how relevant the result is estimated to be. confidence can range from
0.0
to1.0
. The higher the number, the more relevant the document. Theconfidence
value for a result was calculated using the model specified in thedocument_retrieval_strategy
field of the result set.
Array of aggregation results for the query.
- Aggregations
The type of aggregation command used. For example: term, filter, max, min, etc.
Array of passage results for the query.
- Passages
The unique identifier of the document from which the passage has been extracted.
The confidence score of the passages's analysis. A higher score indicates greater confidence.
The content of the extracted passage.
The position of the first character of the extracted passage in the originating field.
The position of the last character of the extracted passage in the originating field.
The label of the field from which the passage has been extracted.
The number of duplicate results removed.
The session token for this query. The session token can be used to add events associated with this query to the query and event log.
Important: Session tokens are case sensitive.
An object contain retrieval type information.
- RetrievalDetails
Indentifies the document retrieval strategy used for this query.
relevancy_training
indicates that the results were returned using a relevancy trained model.continuous_relevancy_training
indicates that the results were returned using the continuous relevancy training model created by result feedback analysis.untrained
means the results were returned using the standard untrained model.Note: In the event of trained collections being queried, but the trained model is not used to return results, the document_retrieval_strategy will be listed as
untrained
.Possible values: [
untrained
,relevancy_training
,continuous_relevancy_training
]
The suggestions for a misspelled natural language query.
Status Code
Query executed successfully.
Bad request.
query and natural_language_query can be used in the same request only if training is complete.
Query timed out.
{ "matching_results": 24, "session_token": "1232139230123123123", "retrieval_details": { "document_retrieval_strategy": "untrained" }, "results": [ { "id": "watson-generated ID", "score": 1 } ], "aggregations": { "term": { "results": [ { "key": "active", "matching_results": 34 } ] } } }
{ "matching_results": 24, "session_token": "1232139230123123123", "retrieval_details": { "document_retrieval_strategy": "untrained" }, "results": [ { "id": "watson-generated ID", "score": 1 } ], "aggregations": { "term": { "results": [ { "key": "active", "matching_results": 34 } ] } } }
Query multiple collection system notices
Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the Discovery documentation for more details on the query language.
Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the Discovery documentation for more details on the query language.
Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the Discovery documentation for more details on the query language.
Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the Discovery documentation for more details on the query language.
Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the Discovery documentation for more details on the query language.
GET /v1/environments/{environment_id}/notices
ServiceCall<QueryNoticesResponse> federatedQueryNotices(FederatedQueryNoticesOptions federatedQueryNoticesOptions)
federatedQueryNotices(params)
federated_query_notices(
self,
environment_id: str,
collection_ids: List[str],
*,
filter: str = None,
query: str = None,
natural_language_query: str = None,
aggregation: str = None,
count: int = None,
return_: List[str] = None,
offset: int = None,
sort: List[str] = None,
highlight: bool = None,
deduplicate_field: str = None,
similar: bool = None,
similar_document_ids: List[str] = None,
similar_fields: List[str] = None,
**kwargs,
) -> DetailedResponse
FederatedQueryNotices(string environmentId, List<string> collectionIds, string filter = null, string query = null, string naturalLanguageQuery = null, string aggregation = null, long? count = null, List<string> _return = null, long? offset = null, List<string> sort = null, bool? highlight = null, string deduplicateField = null, bool? similar = null, List<string> similarDocumentIds = null, List<string> similarFields = null)
Request
Use the FederatedQueryNoticesOptions.Builder
to create a FederatedQueryNoticesOptions
object that contains the parameter values for the federatedQueryNotices
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.A comma-separated list of collection IDs to be queried against.
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return. The maximum for the count and offset values together in any one query is 10000
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
The federatedQueryNotices options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
A comma-separated list of collection IDs to be queried against.
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return. The maximum for the count and offset values together in any one query is 10000.
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
A comma-separated list of collection IDs to be queried against.
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return. The maximum for the count and offset values together in any one query is 10000.
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
A comma-separated list of collection IDs to be queried against.
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return. The maximum for the count and offset values together in any one query is 10000.
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
A comma-separated list of collection IDs to be queried against.
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.
A natural language query that returns relevant documents by utilizing training data and natural language understanding.
An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.
Number of results to return. The maximum for the count and offset values together in any one query is 10000.
Default:
10
A comma-separated list of the portion of the document hierarchy to return.
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified.When true, a highlight field is returned for each result which contains the fields which match the query with
<em></em>
tags around the matching query terms.Default:
false
When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.
When
true
, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.Default:
false
A comma-separated list of document IDs to find similar documents.
Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.
A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.
curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/notices?collection_ids={id1},{id2}&version=2019-04-30&filter=entities.text:error"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.FederatedQueryNotices( environmentId: "{environmentId}", naturalLanguageQuery: "{naturalLanguageQuery}", collectionIds: new List<string> { "{collectionId}" } ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; List<String> collectionIds = Arrays.asList("{collection_id_1}", "{collection_id_2}"); FederatedQueryNoticesOptions.Builder options = new FederatedQueryNoticesOptions.Builder(environmentId, collectionIds) .query("{field}:{value}") .build(); QueryNoticesResponse response = discovery.federatedQueryNotices(options).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const federatedQueryNoticesParams = { environmentId: '{environment_id}', collectionIds: '{comma separated collection ids}', }; discovery.federatedQueryNotices(federatedQueryNoticesParams) .then(queryNoticesResponse => { console.log(JSON.stringify(queryNoticesResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Object containing notice query results.
The number of matching results
Array of document results that match the query.
- results
Array of aggregation results that match the query.
Array of passage results that match the query.
The number of duplicates removed from this notices query.
Object containing notice query results.
{
"matching_results": 24,
"results": [
{
"id": "030ba125-29db-43f2-8552-f941ae30a7a8",
"collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"code": 200,
"score": 1,
"filename": "instructions.html",
"file_type": "html",
"sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
"notices": [
{
"notice_id": "xpath_not_found",
"created": "2016-09-20T17:26:17.000Z",
"document_id": "030ba125-29db-43f2-8552-f941ae30a7a8",
"severity": "warning",
"step": "html-to-html",
"description": "The xpath expression \"boom\" was not found."
}
]
}
],
"aggregations": {
"term": {
"results": [
{
"key": "warning",
"matching_results": 34
}
]
}
}
}
The number of matching results.
Array of document results that match the query.
- results
The unique identifier of the document.
Metadata of the document.
The collection ID of the collection containing the document for this result.
Metadata of a query result.
- resultMetadata
An unbounded measure of the relevance of a particular result, dependent on the query and matching document. A higher score indicates a greater match to the query parameters.
The confidence score for the given result. Calculated based on how relevant the result is estimated to be. confidence can range from
0.0
to1.0
. The higher the number, the more relevant the document. Theconfidence
value for a result was calculated using the model specified in thedocument_retrieval_strategy
field of the result set.
The internal status code returned by the ingestion subsystem indicating the overall result of ingesting the source document.
Name of the original source file (if available).
The type of the original source file.
Possible values: [
pdf
,html
,word
,json
]The SHA-1 hash of the original source file (formatted as a hexadecimal string).
Array of notices for the document.
- notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Array of aggregation results that match the query.
- aggregations
The type of aggregation command used. For example: term, filter, max, min, etc.
Array of passage results that match the query.
- passages
The unique identifier of the document from which the passage has been extracted.
The confidence score of the passages's analysis. A higher score indicates greater confidence.
The content of the extracted passage.
The position of the first character of the extracted passage in the originating field.
The position of the last character of the extracted passage in the originating field.
The label of the field from which the passage has been extracted.
The number of duplicates removed from this notices query.
Object containing notice query results.
{
"matching_results": 24,
"results": [
{
"id": "030ba125-29db-43f2-8552-f941ae30a7a8",
"collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"code": 200,
"score": 1,
"filename": "instructions.html",
"file_type": "html",
"sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
"notices": [
{
"notice_id": "xpath_not_found",
"created": "2016-09-20T17:26:17.000Z",
"document_id": "030ba125-29db-43f2-8552-f941ae30a7a8",
"severity": "warning",
"step": "html-to-html",
"description": "The xpath expression \"boom\" was not found."
}
]
}
],
"aggregations": {
"term": {
"results": [
{
"key": "warning",
"matching_results": 34
}
]
}
}
}
The number of matching results.
Array of document results that match the query.
- results
The unique identifier of the document.
Metadata of the document.
The collection ID of the collection containing the document for this result.
Metadata of a query result.
- result_metadata
An unbounded measure of the relevance of a particular result, dependent on the query and matching document. A higher score indicates a greater match to the query parameters.
The confidence score for the given result. Calculated based on how relevant the result is estimated to be. confidence can range from
0.0
to1.0
. The higher the number, the more relevant the document. Theconfidence
value for a result was calculated using the model specified in thedocument_retrieval_strategy
field of the result set.
The internal status code returned by the ingestion subsystem indicating the overall result of ingesting the source document.
Name of the original source file (if available).
The type of the original source file.
Possible values: [
pdf
,html
,word
,json
]The SHA-1 hash of the original source file (formatted as a hexadecimal string).
Array of notices for the document.
- notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Array of aggregation results that match the query.
- aggregations
The type of aggregation command used. For example: term, filter, max, min, etc.
Array of passage results that match the query.
- passages
The unique identifier of the document from which the passage has been extracted.
The confidence score of the passages's analysis. A higher score indicates greater confidence.
The content of the extracted passage.
The position of the first character of the extracted passage in the originating field.
The position of the last character of the extracted passage in the originating field.
The label of the field from which the passage has been extracted.
The number of duplicates removed from this notices query.
Object containing notice query results.
{
"matching_results": 24,
"results": [
{
"id": "030ba125-29db-43f2-8552-f941ae30a7a8",
"collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"code": 200,
"score": 1,
"filename": "instructions.html",
"file_type": "html",
"sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
"notices": [
{
"notice_id": "xpath_not_found",
"created": "2016-09-20T17:26:17.000Z",
"document_id": "030ba125-29db-43f2-8552-f941ae30a7a8",
"severity": "warning",
"step": "html-to-html",
"description": "The xpath expression \"boom\" was not found."
}
]
}
],
"aggregations": {
"term": {
"results": [
{
"key": "warning",
"matching_results": 34
}
]
}
}
}
The number of matching results.
Array of document results that match the query.
- results
The unique identifier of the document.
Metadata of the document.
The collection ID of the collection containing the document for this result.
Metadata of a query result.
- result_metadata
An unbounded measure of the relevance of a particular result, dependent on the query and matching document. A higher score indicates a greater match to the query parameters.
The confidence score for the given result. Calculated based on how relevant the result is estimated to be. confidence can range from
0.0
to1.0
. The higher the number, the more relevant the document. Theconfidence
value for a result was calculated using the model specified in thedocument_retrieval_strategy
field of the result set.
The internal status code returned by the ingestion subsystem indicating the overall result of ingesting the source document.
Name of the original source file (if available).
The type of the original source file.
Possible values: [
pdf
,html
,word
,json
]The SHA-1 hash of the original source file (formatted as a hexadecimal string).
Array of notices for the document.
- notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Array of aggregation results that match the query.
- aggregations
The type of aggregation command used. For example: term, filter, max, min, etc.
Array of passage results that match the query.
- passages
The unique identifier of the document from which the passage has been extracted.
The confidence score of the passages's analysis. A higher score indicates greater confidence.
The content of the extracted passage.
The position of the first character of the extracted passage in the originating field.
The position of the last character of the extracted passage in the originating field.
The label of the field from which the passage has been extracted.
The number of duplicates removed from this notices query.
Object containing notice query results.
{
"matching_results": 24,
"results": [
{
"id": "030ba125-29db-43f2-8552-f941ae30a7a8",
"collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
"code": 200,
"score": 1,
"filename": "instructions.html",
"file_type": "html",
"sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
"notices": [
{
"notice_id": "xpath_not_found",
"created": "2016-09-20T17:26:17.000Z",
"document_id": "030ba125-29db-43f2-8552-f941ae30a7a8",
"severity": "warning",
"step": "html-to-html",
"description": "The xpath expression \"boom\" was not found."
}
]
}
],
"aggregations": {
"term": {
"results": [
{
"key": "warning",
"matching_results": 34
}
]
}
}
}
The number of matching results.
Array of document results that match the query.
- Results
The unique identifier of the document.
Metadata of the document.
The collection ID of the collection containing the document for this result.
Metadata of a query result.
- ResultMetadata
An unbounded measure of the relevance of a particular result, dependent on the query and matching document. A higher score indicates a greater match to the query parameters.
The confidence score for the given result. Calculated based on how relevant the result is estimated to be. confidence can range from
0.0
to1.0
. The higher the number, the more relevant the document. Theconfidence
value for a result was calculated using the model specified in thedocument_retrieval_strategy
field of the result set.
The internal status code returned by the ingestion subsystem indicating the overall result of ingesting the source document.
Name of the original source file (if available).
The type of the original source file.
Possible values: [
pdf
,html
,word
,json
]The SHA-1 hash of the original source file (formatted as a hexadecimal string).
Array of notices for the document.
- Notices
Identifies the notice. Many notices might have the same ID. This field exists so that user applications can programmatically identify a notice and take automatic corrective action. Typical notice IDs include:
index_failed
,index_failed_too_many_requests
,index_failed_incompatible_field
,index_failed_cluster_unavailable
,ingestion_timeout
,ingestion_error
,bad_request
,internal_error
,missing_model
,unsupported_model
,smart_document_understanding_failed_incompatible_field
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_internal_error
,smart_document_understanding_failed_warning
,smart_document_understanding_page_error
,smart_document_understanding_page_warning
. Note: This is not a complete list; other values might be returned.The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
Unique identifier of the document.
Unique identifier of the query used for relevance training.
Severity level of the notice.
Possible values: [
warning
,error
]Ingestion or training step in which the notice occurred. Typical step values include:
smartDocumentUnderstanding
,ingestion
,indexing
,convert
. Note: This is not a complete list; other values might be returned.The description of the notice.
Array of aggregation results that match the query.
- Aggregations
The type of aggregation command used. For example: term, filter, max, min, etc.
Array of passage results that match the query.
- Passages
The unique identifier of the document from which the passage has been extracted.
The confidence score of the passages's analysis. A higher score indicates greater confidence.
The content of the extracted passage.
The position of the first character of the extracted passage in the originating field.
The position of the last character of the extracted passage in the originating field.
The label of the field from which the passage has been extracted.
The number of duplicates removed from this notices query.
Status Code
Query for notices executed successfully.
Bad request.
{ "matching_results": 24, "results": [ { "id": "030ba125-29db-43f2-8552-f941ae30a7a8", "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37", "code": 200, "score": 1, "filename": "instructions.html", "file_type": "html", "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3", "notices": [ { "notice_id": "xpath_not_found", "created": "2016-09-20T17:26:17.000Z", "document_id": "030ba125-29db-43f2-8552-f941ae30a7a8", "severity": "warning", "step": "html-to-html", "description": "The xpath expression \"boom\" was not found." } ] } ], "aggregations": { "term": { "results": [ { "key": "warning", "matching_results": 34 } ] } } }
{ "matching_results": 24, "results": [ { "id": "030ba125-29db-43f2-8552-f941ae30a7a8", "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37", "code": 200, "score": 1, "filename": "instructions.html", "file_type": "html", "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3", "notices": [ { "notice_id": "xpath_not_found", "created": "2016-09-20T17:26:17.000Z", "document_id": "030ba125-29db-43f2-8552-f941ae30a7a8", "severity": "warning", "step": "html-to-html", "description": "The xpath expression \"boom\" was not found." } ] } ], "aggregations": { "term": { "results": [ { "key": "warning", "matching_results": 34 } ] } } }
Get Autocomplete Suggestions
Returns completion query suggestions for the specified prefix. /n/n Important: this method is only valid when using the Cloud Pak version of Discovery.
Returns completion query suggestions for the specified prefix. /n/n Important: this method is only valid when using the Cloud Pak version of Discovery.
Returns completion query suggestions for the specified prefix. /n/n Important: this method is only valid when using the Cloud Pak version of Discovery.
Returns completion query suggestions for the specified prefix. /n/n Important: this method is only valid when using the Cloud Pak version of Discovery.
Returns completion query suggestions for the specified prefix. /n/n Important: this method is only valid when using the Cloud Pak version of Discovery.
GET /v1/environments/{environment_id}/collections/{collection_id}/autocompletion
ServiceCall<Completions> getAutocompletion(GetAutocompletionOptions getAutocompletionOptions)
getAutocompletion(params)
get_autocompletion(
self,
environment_id: str,
collection_id: str,
prefix: str,
*,
field: str = None,
count: int = None,
**kwargs,
) -> DetailedResponse
GetAutocompletion(string environmentId, string collectionId, string prefix, string field = null, long? count = null)
Request
Use the GetAutocompletionOptions.Builder
to create a GetAutocompletionOptions
object that contains the parameter values for the getAutocompletion
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.The prefix to use for autocompletion. For example, the prefix
Ho
could autocomplete tohot
,housing
, orhow
.The field in the result documents that autocompletion suggestions are identified from.
The number of autocompletion suggestions to return.
Default:
5
The getAutocompletion options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The prefix to use for autocompletion. For example, the prefix
Ho
could autocomplete tohot
,housing
, orhow
.The field in the result documents that autocompletion suggestions are identified from.
The number of autocompletion suggestions to return.
Default:
5
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The prefix to use for autocompletion. For example, the prefix
Ho
could autocomplete tohot
,housing
, orhow
.The field in the result documents that autocompletion suggestions are identified from.
The number of autocompletion suggestions to return.
Default:
5
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The prefix to use for autocompletion. For example, the prefix
Ho
could autocomplete tohot
,housing
, orhow
.The field in the result documents that autocompletion suggestions are identified from.
The number of autocompletion suggestions to return.
Default:
5
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The prefix to use for autocompletion. For example, the prefix
Ho
could autocomplete tohot
,housing
, orhow
.The field in the result documents that autocompletion suggestions are identified from.
The number of autocompletion suggestions to return.
Default:
5
curl -X GET -H "Authorization: Bearer {auth-token}" "https://{icp4d_cluster_host}{:port}/discovery/{release}/instances/{instance_id}/api/v1/environments/{environment_id}/collections/{collection_id}/autocompletion?field=text&prefix=Ho&version=2019-07-28"
Response
An object containing an array of autocompletion suggestions.
Array of autcomplete suggestion based on the provided prefix.
An object containing an array of autocompletion suggestions.
Array of autcomplete suggestion based on the provided prefix.
An object containing an array of autocompletion suggestions.
Array of autcomplete suggestion based on the provided prefix.
An object containing an array of autocompletion suggestions.
Array of autcomplete suggestion based on the provided prefix.
An object containing an array of autocompletion suggestions.
Array of autcomplete suggestion based on the provided prefix.
Status Code
Object containing array of possible completions.
The specified field does not exist.
No Sample Response
List training data
Lists the training data for the specified collection.
Lists the training data for the specified collection.
Lists the training data for the specified collection.
Lists the training data for the specified collection.
Lists the training data for the specified collection.
GET /v1/environments/{environment_id}/collections/{collection_id}/training_data
ServiceCall<TrainingDataSet> listTrainingData(ListTrainingDataOptions listTrainingDataOptions)
listTrainingData(params)
list_training_data(
self,
environment_id: str,
collection_id: str,
**kwargs,
) -> DetailedResponse
ListTrainingData(string environmentId, string collectionId)
Request
Use the ListTrainingDataOptions.Builder
to create a ListTrainingDataOptions
object that contains the parameter values for the listTrainingData
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The listTrainingData options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/training_data?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.ListTrainingData( environmentId: "{environmentId}", collectionId: "{collectionId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; ListTrainingDataOptions options = new ListTrainingDataOptions.Builder(environmentId, collectionId).build(); TrainingDataSet response = discovery.listTrainingData(options).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const listTrainingDataParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', }; discovery.listTrainingData(listTrainingDataParams) .then(trainingDataSet => { console.log(JSON.stringify(trainingDataSet, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Training information for a specific collection.
The environment id associated with this training data set.
The collection id associated with this training data set.
Array of training queries. At least 50 queries are required for training to begin. A maximum of 10,000 queries are returned.
Possible values: 50 ≤ number of items ≤ 10000
Training information for a specific collection.
The environment id associated with this training data set.
The collection id associated with this training data set.
Array of training queries. At least 50 queries are required for training to begin. A maximum of 10,000 queries are returned.
Possible values: 50 ≤ number of items ≤ 10000
- queries
The query ID associated with the training query.
The natural text query for the training query.
The filter used on the collection before the natural_language_query is applied.
Array of training examples.
- examples
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Training information for a specific collection.
The environment id associated with this training data set.
The collection id associated with this training data set.
Array of training queries. At least 50 queries are required for training to begin. A maximum of 10,000 queries are returned.
Possible values: 50 ≤ number of items ≤ 10000
- queries
The query ID associated with the training query.
The natural text query for the training query.
The filter used on the collection before the natural_language_query is applied.
Array of training examples.
- examples
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Training information for a specific collection.
The environment id associated with this training data set.
The collection id associated with this training data set.
Array of training queries. At least 50 queries are required for training to begin. A maximum of 10,000 queries are returned.
Possible values: 50 ≤ number of items ≤ 10000
- queries
The query ID associated with the training query.
The natural text query for the training query.
The filter used on the collection before the natural_language_query is applied.
Array of training examples.
- examples
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Training information for a specific collection.
The environment id associated with this training data set.
The collection id associated with this training data set.
Array of training queries. At least 50 queries are required for training to begin. A maximum of 10,000 queries are returned.
Possible values: 50 ≤ number of items ≤ 10000
- Queries
The query ID associated with the training query.
The natural text query for the training query.
The filter used on the collection before the natural_language_query is applied.
Array of training examples.
- Examples
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Status Code
Training data for this collection found and returned.
No Sample Response
Add query to training data
Adds a query to the training data for this collection. The query can contain a filter and natural language query.
Adds a query to the training data for this collection. The query can contain a filter and natural language query.
Adds a query to the training data for this collection. The query can contain a filter and natural language query.
Adds a query to the training data for this collection. The query can contain a filter and natural language query.
Adds a query to the training data for this collection. The query can contain a filter and natural language query.
POST /v1/environments/{environment_id}/collections/{collection_id}/training_data
ServiceCall<TrainingQuery> addTrainingData(AddTrainingDataOptions addTrainingDataOptions)
addTrainingData(params)
add_training_data(
self,
environment_id: str,
collection_id: str,
*,
natural_language_query: str = None,
filter: str = None,
examples: List['TrainingExample'] = None,
**kwargs,
) -> DetailedResponse
AddTrainingData(string environmentId, string collectionId, string naturalLanguageQuery = null, string filter = null, List<TrainingExample> examples = null)
Request
Use the AddTrainingDataOptions.Builder
to create a AddTrainingDataOptions
object that contains the parameter values for the addTrainingData
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The body of the training data query that is to be added to the collection's training data.
{
"natural_language_query": "why is the sky blue",
"filter": "text:meteorology",
"examples": [
{
"document_id": "54f95ac0-3e4f-4756-bea6-7a67b2713c81",
"relevance": 1
},
{
"document_id": "01bcca32-7300-4c9f-8d32-33ed7ea643da",
"cross_reference": "my_id_field:1463",
"relevance": 5
}
]
}
The natural text query for the new training query.
The filter used on the collection before the natural_language_query is applied.
Array of training examples.
The addTrainingData options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The natural text query for the new training query.
The filter used on the collection before the natural_language_query is applied.
Array of training examples.
- examples
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The natural text query for the new training query.
The filter used on the collection before the natural_language_query is applied.
Array of training examples.
- examples
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The natural text query for the new training query.
The filter used on the collection before the natural_language_query is applied.
Array of training examples.
- examples
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The natural text query for the new training query.
The filter used on the collection before the natural_language_query is applied.
Array of training examples.
- examples
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
curl -X POST -u "apikey":"{apikey}" -H "Content-Type: application/json" -d '{ "natural_language_query": "who is keyser soze", "filter": "text:criminology", "examples": [ { "document_id": "adaf50f1-2526-4fad-b670-7d6e8a42e6e6", "relevance": 2 }, { "document_id": "63919442-7d5b-4cae-ab7e-56f58b1390fe", "cross_reference": "my_id_field:14", "relevance": 4 } ] }' "{url}/v1/environments/{environment_id}/collections/{collection_id}/training_data?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var examples = new List<TrainingExample>() { new TrainingExample() { DocumentId = "{documentId}", CrossReference = "{crossReference}" } }; var result = discovery.AddTrainingData( environmentId: "{environmentId}", collectionId: "{collectionId}", naturalLanguageQuery: "{naturalLanguageQuery}", filter: "{filter}", examples: examples ); queryId = result.Result.QueryId; Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; String naturalLanguageQuery = "who is keyser soze"; String filter = "text:criminology"; AddTrainingDataOptions options = new AddTrainingDataOptions.Builder(environmentId, collectionId) .naturalLanguageQuery(naturalLanguageQuery) .filter(filter) .build(); TrainingQuery response = discovery.addTrainingData(options).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const addTrainingDataParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', naturalLanguageQuery: 'watson', }; discovery.addTrainingData(addTrainingDataParams) .then(trainingQuery => { console.log(JSON.stringify(trainingQuery, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Training query details.
The query ID associated with the training query.
The natural text query for the training query.
The filter used on the collection before the natural_language_query is applied.
Array of training examples.
Training query details.
The query ID associated with the training query.
The natural text query for the training query.
The filter used on the collection before the natural_language_query is applied.
Array of training examples.
- examples
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Training query details.
The query ID associated with the training query.
The natural text query for the training query.
The filter used on the collection before the natural_language_query is applied.
Array of training examples.
- examples
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Training query details.
The query ID associated with the training query.
The natural text query for the training query.
The filter used on the collection before the natural_language_query is applied.
Array of training examples.
- examples
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Training query details.
The query ID associated with the training query.
The natural text query for the training query.
The filter used on the collection before the natural_language_query is applied.
Array of training examples.
- Examples
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Status Code
The query was successfully added.
Bad request.
No Sample Response
Delete all training data
Deletes all training data from a collection.
Deletes all training data from a collection.
Deletes all training data from a collection.
Deletes all training data from a collection.
Deletes all training data from a collection.
DELETE /v1/environments/{environment_id}/collections/{collection_id}/training_data
ServiceCall<Void> deleteAllTrainingData(DeleteAllTrainingDataOptions deleteAllTrainingDataOptions)
deleteAllTrainingData(params)
delete_all_training_data(
self,
environment_id: str,
collection_id: str,
**kwargs,
) -> DetailedResponse
DeleteAllTrainingData(string environmentId, string collectionId)
Request
Use the DeleteAllTrainingDataOptions.Builder
to create a DeleteAllTrainingDataOptions
object that contains the parameter values for the deleteAllTrainingData
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The deleteAllTrainingData options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -X DELETE -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/training_data?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.DeleteAllTrainingData( environmentId: "{environmentId}", collectionId: "{collectionId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; DeleteAllTrainingDataOptions options = new DeleteAllTrainingDataOptions.Builder(environmentId, collectionId).build(); discovery.deleteAllTrainingData(options).execute();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const deleteAllTrainingDataParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', }; discovery.deleteAllTrainingData(deleteAllTrainingDataParams) .then(result => { console.log(JSON.stringify(result, null, 2)); }) .catch(err => { console.log('error:', err); });
Get details about a query
Gets details for a specific training data query, including the query string and all examples.
Gets details for a specific training data query, including the query string and all examples.
Gets details for a specific training data query, including the query string and all examples.
Gets details for a specific training data query, including the query string and all examples.
Gets details for a specific training data query, including the query string and all examples.
GET /v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}
ServiceCall<TrainingQuery> getTrainingData(GetTrainingDataOptions getTrainingDataOptions)
getTrainingData(params)
get_training_data(
self,
environment_id: str,
collection_id: str,
query_id: str,
**kwargs,
) -> DetailedResponse
GetTrainingData(string environmentId, string collectionId, string queryId)
Request
Use the GetTrainingDataOptions.Builder
to create a GetTrainingDataOptions
object that contains the parameter values for the getTrainingData
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The getTrainingData options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.GetTrainingData( environmentId: "{environmentId}", collectionId: "{collectionId}", queryId: "{queryId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; String queryId = "{query_id}"; GetTrainingDataOptions options = new GetTrainingDataOptions.Builder(environmentId, collectionId, queryId).build(); TrainingQuery response = discovery.getTrainingData(options).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const getTrainingDataParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', queryId: '{query_id}', }; discovery.getTrainingData(getTrainingDataParams) .then(trainingQuery => { console.log(JSON.stringify(trainingQuery, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Training query details.
The query ID associated with the training query.
The natural text query for the training query.
The filter used on the collection before the natural_language_query is applied.
Array of training examples.
Training query details.
The query ID associated with the training query.
The natural text query for the training query.
The filter used on the collection before the natural_language_query is applied.
Array of training examples.
- examples
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Training query details.
The query ID associated with the training query.
The natural text query for the training query.
The filter used on the collection before the natural_language_query is applied.
Array of training examples.
- examples
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Training query details.
The query ID associated with the training query.
The natural text query for the training query.
The filter used on the collection before the natural_language_query is applied.
Array of training examples.
- examples
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Training query details.
The query ID associated with the training query.
The natural text query for the training query.
The filter used on the collection before the natural_language_query is applied.
Array of training examples.
- Examples
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Status Code
Details for this training query found and returned.
The query does not exist.
No Sample Response
Delete a training data query
Removes the training data query and all associated examples from the training data set.
Removes the training data query and all associated examples from the training data set.
Removes the training data query and all associated examples from the training data set.
Removes the training data query and all associated examples from the training data set.
Removes the training data query and all associated examples from the training data set.
DELETE /v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}
ServiceCall<Void> deleteTrainingData(DeleteTrainingDataOptions deleteTrainingDataOptions)
deleteTrainingData(params)
delete_training_data(
self,
environment_id: str,
collection_id: str,
query_id: str,
**kwargs,
) -> DetailedResponse
DeleteTrainingData(string environmentId, string collectionId, string queryId)
Request
Use the DeleteTrainingDataOptions.Builder
to create a DeleteTrainingDataOptions
object that contains the parameter values for the deleteTrainingData
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The deleteTrainingData options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -X DELETE -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.DeleteTrainingData( environmentId: "{environmentId}", collectionId: "{collectionId}", queryId: "{queryId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; String queryId = "{query_id}"; DeleteTrainingDataOptions options = new DeleteTrainingDataOptions.Builder(environmentId, collectionId, queryId).build(); discovery.deleteTrainingData(options).execute();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const deleteTrainingDataParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', queryId: '{query_id}', }; discovery.deleteTrainingData(deleteTrainingDataParams) .then(result => { console.log(JSON.stringify(result, null, 2)); }) .catch(err => { console.log('error:', err); });
List examples for a training data query
List all examples for this training data query.
List all examples for this training data query.
List all examples for this training data query.
List all examples for this training data query.
List all examples for this training data query.
GET /v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples
ServiceCall<TrainingExampleList> listTrainingExamples(ListTrainingExamplesOptions listTrainingExamplesOptions)
listTrainingExamples(params)
list_training_examples(
self,
environment_id: str,
collection_id: str,
query_id: str,
**kwargs,
) -> DetailedResponse
ListTrainingExamples(string environmentId, string collectionId, string queryId)
Request
Use the ListTrainingExamplesOptions.Builder
to create a ListTrainingExamplesOptions
object that contains the parameter values for the listTrainingExamples
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The listTrainingExamples options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.ListTrainingExamples( environmentId: "{environmentId}", collectionId: "{collectionId}", queryId: "{queryId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; String queryId = "{query_id}"; ListTrainingExamplesOptions options = new ListTrainingExamplesOptions.Builder(environmentId, collectionId, queryId).build(); TrainingExampleList response = discovery.listTrainingExamples(options).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const listTrainingExamplesParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', queryId: '{query_id}', }; discovery.listTrainingExamples(listTrainingExamplesParams) .then(trainingExampleList => { console.log(JSON.stringify(trainingExampleList, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Object containing an array of training examples.
Array of training examples.
Object containing an array of training examples.
Array of training examples.
- examples
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Object containing an array of training examples.
Array of training examples.
- examples
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Object containing an array of training examples.
Array of training examples.
- examples
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Object containing an array of training examples.
Array of training examples.
- Examples
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Status Code
A list of all training examples added for this query.
Query not found.
No Sample Response
Add example to training data query
Adds a example to this training data query.
Adds a example to this training data query.
Adds a example to this training data query.
Adds a example to this training data query.
Adds a example to this training data query.
POST /v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples
ServiceCall<TrainingExample> createTrainingExample(CreateTrainingExampleOptions createTrainingExampleOptions)
createTrainingExample(params)
create_training_example(
self,
environment_id: str,
collection_id: str,
query_id: str,
*,
document_id: str = None,
cross_reference: str = None,
relevance: int = None,
**kwargs,
) -> DetailedResponse
CreateTrainingExample(string environmentId, string collectionId, string queryId, string documentId = null, string crossReference = null, long? relevance = null)
Request
Use the CreateTrainingExampleOptions.Builder
to create a CreateTrainingExampleOptions
object that contains the parameter values for the createTrainingExample
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The body of the example that is to be added to the specified query.
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example
The createTrainingExample options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
curl -X POST -u "apikey":"{apikey}" -H "Content-Type: application/json" -d '{ "document_id": "{document_id}", "cross_reference": "{cross_reference}", "relevance": 0 }' "{url}/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.CreateTrainingExample( environmentId: "{environmentId}", collectionId: "{collectionId}", queryId: "{queryId}", documentId: "{documentId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; String queryId = "{query_id}"; String documentId = "{document_id}"; CreateTrainingExampleOptions options = new CreateTrainingExampleOptions.Builder(environmentId, collectionId, queryId) .documentId(documentId) .build(); TrainingExample response = discovery.createTrainingExample(options).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const createTrainingExampleParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', queryId: '{query_id}', documentId: '{document_id}', relevance: 1, }; discovery.createTrainingExample(createTrainingExampleParams) .then(trainingExample => { console.log(JSON.stringify(trainingExample, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Training example details.
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example
Training example details.
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Training example details.
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Training example details.
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Training example details.
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Status Code
The example was successfully added to the query.
Bad request.
No Sample Response
Delete example for training data query
Deletes the example document with the given ID from the training data query.
Deletes the example document with the given ID from the training data query.
Deletes the example document with the given ID from the training data query.
Deletes the example document with the given ID from the training data query.
Deletes the example document with the given ID from the training data query.
DELETE /v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples/{example_id}
ServiceCall<Void> deleteTrainingExample(DeleteTrainingExampleOptions deleteTrainingExampleOptions)
deleteTrainingExample(params)
delete_training_example(
self,
environment_id: str,
collection_id: str,
query_id: str,
example_id: str,
**kwargs,
) -> DetailedResponse
DeleteTrainingExample(string environmentId, string collectionId, string queryId, string exampleId)
Request
Use the DeleteTrainingExampleOptions.Builder
to create a DeleteTrainingExampleOptions
object that contains the parameter values for the deleteTrainingExample
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the document as it is indexed.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The deleteTrainingExample options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document as it is indexed.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document as it is indexed.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document as it is indexed.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document as it is indexed.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -X DELETE -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples/{example_id}?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.DeleteTrainingExample( environmentId: "{environmentId}", collectionId: "{collectionId}", queryId: "{queryId}", exampleId: "{exampleId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; String queryId = "{query_id}"; String exampleId = "{example_id}"; DeleteTrainingExampleOptions options = new DeleteTrainingExampleOptions.Builder(environmentId, collectionId, queryId, exampleId).build(); discovery.deleteTrainingExample(options).execute();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const deleteTrainingExampleParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', queryId: '{query_id}', exampleId: '{example_id}', }; discovery.deleteTrainingExample(deleteTrainingExampleParams) .then(result => { console.log(JSON.stringify(result, null, 2)); }) .catch(err => { console.log('error:', err); });
Change label or cross reference for example
Changes the label or cross reference query for this training data example.
Changes the label or cross reference query for this training data example.
Changes the label or cross reference query for this training data example.
Changes the label or cross reference query for this training data example.
Changes the label or cross reference query for this training data example.
PUT /v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples/{example_id}
ServiceCall<TrainingExample> updateTrainingExample(UpdateTrainingExampleOptions updateTrainingExampleOptions)
updateTrainingExample(params)
update_training_example(
self,
environment_id: str,
collection_id: str,
query_id: str,
example_id: str,
*,
cross_reference: str = None,
relevance: int = None,
**kwargs,
) -> DetailedResponse
UpdateTrainingExample(string environmentId, string collectionId, string queryId, string exampleId, string crossReference = null, long? relevance = null)
Request
Use the UpdateTrainingExampleOptions.Builder
to create a UpdateTrainingExampleOptions
object that contains the parameter values for the updateTrainingExample
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the document as it is indexed.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The body of the example that is to be added to the specified query.
The example to add.
The relevance value for this example.
The updateTrainingExample options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document as it is indexed.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The example to add.
The relevance value for this example.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document as it is indexed.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The example to add.
The relevance value for this example.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document as it is indexed.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The example to add.
The relevance value for this example.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document as it is indexed.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The example to add.
The relevance value for this example.
curl -X PUT -u "apikey":"{apikey}" -d '{ "document_id": "string", "cross_reference": "{new_cross_reference}", "relevance": 3 }' "{url}/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples/{example_id}?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.UpdateTrainingExample( environmentId: "{environmentId}", collectionId: "{collectionId}", queryId: "{queryId}", exampleId: "{exampleId}", crossReference: "{crossReference}", relevance: 1 ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; String queryId = "{query_id}"; String exampleId = "{example_id}"; String newCrossReference = "new_cross_reference"; UpdateTrainingExampleOptions options = new UpdateTrainingExampleOptions.Builder(environmentId, collectionId, queryId, exampleId) .crossReference(newCrossReference) .build(); TrainingExample response = discovery.deleteTrainingExample(options).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const updateTrainingExampleParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', queryId: '{query_id}', exampleId: '{example_id}', relevance: 2, }; discovery.updateTrainingExample(updateTrainingExampleParams) .then(trainingExample => { console.log(JSON.stringify(trainingExample, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Training example details.
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example
Training example details.
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Training example details.
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Training example details.
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Training example details.
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Status Code
The label or cross reference query were successfully applied.
Bad request.
No Sample Response
Get details for training data example
Gets the details for this training example.
Gets the details for this training example.
Gets the details for this training example.
Gets the details for this training example.
Gets the details for this training example.
GET /v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples/{example_id}
ServiceCall<TrainingExample> getTrainingExample(GetTrainingExampleOptions getTrainingExampleOptions)
getTrainingExample(params)
get_training_example(
self,
environment_id: str,
collection_id: str,
query_id: str,
example_id: str,
**kwargs,
) -> DetailedResponse
GetTrainingExample(string environmentId, string collectionId, string queryId, string exampleId)
Request
Use the GetTrainingExampleOptions.Builder
to create a GetTrainingExampleOptions
object that contains the parameter values for the getTrainingExample
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The ID of the document as it is indexed.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The getTrainingExample options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document as it is indexed.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document as it is indexed.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document as it is indexed.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the collection.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the query used for training.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The ID of the document as it is indexed.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.GetTrainingExample( environmentId: "{environmentId}", collectionId: "{collectionId}", queryId: "{queryId}", exampleId: "{exampleId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; String queryId = "{query_id}"; String documentId = "{document_id}"; GetTrainingExampleOptions options = new GetTrainingExampleOptions.Builder(environmentId, collectionId, queryId, documentId).build(); TrainingExample response = discovery.getTrainingExample(options).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const getTrainingExampleParams = { environmentId: '{environment_id}', collectionId: '{collection_id}', queryId: '{query_id}', exampleId: '{example_id}', }; discovery.getTrainingExample(getTrainingExampleParams) .then(trainingExample => { console.log(JSON.stringify(trainingExample, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Training example details.
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example
Training example details.
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Training example details.
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Training example details.
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Training example details.
The document ID associated with this training example.
The cross reference associated with this training example.
The relevance of the training example.
Status Code
Details for this example successfully found and returned.
The query or the example does not exist.
No Sample Response
Delete labeled data
Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with the customer ID.
You associate a customer ID with data by passing the X-Watson-Metadata header with a request that passes data. For more information about personal data and customer IDs, see Information security.
Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with the customer ID.
You associate a customer ID with data by passing the X-Watson-Metadata header with a request that passes data. For more information about personal data and customer IDs, see Information security.
Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with the customer ID.
You associate a customer ID with data by passing the X-Watson-Metadata header with a request that passes data. For more information about personal data and customer IDs, see Information security.
Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with the customer ID.
You associate a customer ID with data by passing the X-Watson-Metadata header with a request that passes data. For more information about personal data and customer IDs, see Information security.
Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with the customer ID.
You associate a customer ID with data by passing the X-Watson-Metadata header with a request that passes data. For more information about personal data and customer IDs, see Information security.
DELETE /v1/user_data
ServiceCall<Void> deleteUserData(DeleteUserDataOptions deleteUserDataOptions)
deleteUserData(params)
delete_user_data(
self,
customer_id: str,
**kwargs,
) -> DetailedResponse
DeleteUserData(string customerId)
Request
Use the DeleteUserDataOptions.Builder
to create a DeleteUserDataOptions
object that contains the parameter values for the deleteUserData
method.
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.The customer ID for which all data is to be deleted.
The deleteUserData options.
The customer ID for which all data is to be deleted.
parameters
The customer ID for which all data is to be deleted.
parameters
The customer ID for which all data is to be deleted.
parameters
The customer ID for which all data is to be deleted.
curl -X DELETE -u "apikey":"{apikey}" "{url}/v1/user_data?customer_id=customer&version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.DeleteUserData( customerId: "{id}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); DeleteUserDataOptions deleteUserDataOptions = new DeleteUserDataOptions.Builder() .customer_id("my_customer_ID") .build(); discovery.deleteUserData(deleteUserDataOptions).execute();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const deleteUserDataParams = { customerId: '{customer_id}', }; discovery.deleteUserData(deleteUserDataParams) .then(result => { console.log(JSON.stringify(result, null, 2)); }) .catch(err => { console.log('error:', err); });
import json from ibm_watson import DiscoveryV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator authenticator = IAMAuthenticator('{apikey}') discovery = DiscoveryV1( version='2019-04-30', authenticator=authenticator ) discovery.set_service_url('{url}') discovery.delete_user_data( customer_id = '{id}' ).get_result()
Create event
The Events API can be used to create log entries that are associated with specific queries. For example, you can record which documents in the results set were "clicked" by a user and when that click occurred.
The Events API can be used to create log entries that are associated with specific queries. For example, you can record which documents in the results set were "clicked" by a user and when that click occurred.
The Events API can be used to create log entries that are associated with specific queries. For example, you can record which documents in the results set were "clicked" by a user and when that click occurred.
The Events API can be used to create log entries that are associated with specific queries. For example, you can record which documents in the results set were "clicked" by a user and when that click occurred.
The Events API can be used to create log entries that are associated with specific queries. For example, you can record which documents in the results set were "clicked" by a user and when that click occurred.
POST /v1/events
ServiceCall<CreateEventResponse> createEvent(CreateEventOptions createEventOptions)
createEvent(params)
create_event(
self,
type: str,
data: 'EventData',
**kwargs,
) -> DetailedResponse
CreateEvent(string type, EventData data)
Request
Use the CreateEventOptions.Builder
to create a CreateEventOptions
object that contains the parameter values for the createEvent
method.
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
An object that defines a query event to be added to the log.
The event type to be created.
Allowable values: [
click
]Query event data object.
The createEvent options.
The event type to be created.
Allowable values: [
click
]Query event data object.
- data
The environment_id associated with the query that the event is associated with.
The session token that was returned as part of the query results that this event is associated with.
The optional timestamp for the event that was created. If not provided, the time that the event was created in the log was used.
The rank of the result item which the event is associated with.
The collection_id of the document that this event is associated with.
The document_id of the document that this event is associated with.
parameters
The event type to be created.
Allowable values: [
click
]Query event data object.
- data
The environment_id associated with the query that the event is associated with.
The session token that was returned as part of the query results that this event is associated with.
The optional timestamp for the event that was created. If not provided, the time that the event was created in the log was used.
The rank of the result item which the event is associated with.
The collection_id of the document that this event is associated with.
The document_id of the document that this event is associated with.
parameters
The event type to be created.
Allowable values: [
click
]Query event data object.
- data
The environment_id associated with the query that the event is associated with.
The session token that was returned as part of the query results that this event is associated with.
The optional timestamp for the event that was created. If not provided, the time that the event was created in the log was used.
The rank of the result item which the event is associated with.
The collection_id of the document that this event is associated with.
The document_id of the document that this event is associated with.
parameters
The event type to be created.
Allowable values: [
click
]Query event data object.
- data
The environment_id associated with the query that the event is associated with.
The session token that was returned as part of the query results that this event is associated with.
The optional timestamp for the event that was created. If not provided, the time that the event was created in the log was used.
The rank of the result item which the event is associated with.
The collection_id of the document that this event is associated with.
The document_id of the document that this event is associated with.
curl -u "apikey":"{apikey}" -X POST -H "Content-Type: application/json" -d '{"type": "click", "data": { "environment_id": "e6061c99-950a-4dad-aee0-411f7143690a", "session_token": "1_1dlwjrntwodlw111344", "client_timestamp": "2018-01-29T14:58:39.470Z", "display_rank": 1, "collection_id": "a83aaa222aaa222aac460", "document_id": "584857e87807ff4709f3749eb99a05d3" } }' "{url}/v1/events?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var data = new EventData() { EnvironmentId = "{environmentId}", SessionToken = "{sessionToken}", CollectionId = "{collectionId}", DocumentId = "{documentId}" }; var result = discovery.CreateEvent( type: CreateEventResponse.TypeEnumValue.CLICK, data: data ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String collectionId = "{collection_id}"; String documentId = "{document_id}"; String sessionToken = "{session_token}"; EventData eventData = new EventData(); eventData.setEnvironmentId(environmentId); eventData.setCollectionId(collectionId); eventData.setDocumentId(documentId); eventData.setSessionToken(sessionToken); CreateEventOptions createEventOptions = new CreateEventOptions.Builder() .type("click") .data(eventData) .build(); CreateEventResponse response = discovery.createEvent(createEventOptions).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const createEventParams = { type: 'click', data: { environment_id: '{environment_id}', session_token: '{session_token}', collection_id: '{collection_id}', document_id: '{document_id}', } }; discovery.createEvent(createEventParams) .then(createEventResponse => { console.log(JSON.stringify(createEventResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
An object defining the event being created.
The event type that was created.
Possible values: [
click
]Query event data object.
An object defining the event being created.
The event type that was created.
Possible values: [
click
]Query event data object.
- data
The environment_id associated with the query that the event is associated with.
The session token that was returned as part of the query results that this event is associated with.
The optional timestamp for the event that was created. If not provided, the time that the event was created in the log was used.
The rank of the result item which the event is associated with.
The collection_id of the document that this event is associated with.
The document_id of the document that this event is associated with.
The query identifier stored in the log. The query and any events associated with that query are stored with the same query_id.
An object defining the event being created.
The event type that was created.
Possible values: [
click
]Query event data object.
- data
The environment_id associated with the query that the event is associated with.
The session token that was returned as part of the query results that this event is associated with.
The optional timestamp for the event that was created. If not provided, the time that the event was created in the log was used.
The rank of the result item which the event is associated with.
The collection_id of the document that this event is associated with.
The document_id of the document that this event is associated with.
The query identifier stored in the log. The query and any events associated with that query are stored with the same query_id.
An object defining the event being created.
The event type that was created.
Possible values: [
click
]Query event data object.
- data
The environment_id associated with the query that the event is associated with.
The session token that was returned as part of the query results that this event is associated with.
The optional timestamp for the event that was created. If not provided, the time that the event was created in the log was used.
The rank of the result item which the event is associated with.
The collection_id of the document that this event is associated with.
The document_id of the document that this event is associated with.
The query identifier stored in the log. The query and any events associated with that query are stored with the same query_id.
An object defining the event being created.
The event type that was created.
Possible values: [
click
]Query event data object.
- Data
The environment_id associated with the query that the event is associated with.
The session token that was returned as part of the query results that this event is associated with.
The optional timestamp for the event that was created. If not provided, the time that the event was created in the log was used.
The rank of the result item which the event is associated with.
The collection_id of the document that this event is associated with.
The document_id of the document that this event is associated with.
The query identifier stored in the log. The query and any events associated with that query are stored with the same query_id.
Status Code
The event object was successfully accepted.
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
Request contains invalid content and cannot be added. The error message contains details about what caused the request to be rejected.
No Sample Response
Search the query and event log
Searches the query and event log to find query sessions that match the specified criteria. Searching the logs endpoint uses the standard Discovery query syntax for the parameters that are supported.
Searches the query and event log to find query sessions that match the specified criteria. Searching the logs endpoint uses the standard Discovery query syntax for the parameters that are supported.
Searches the query and event log to find query sessions that match the specified criteria. Searching the logs endpoint uses the standard Discovery query syntax for the parameters that are supported.
Searches the query and event log to find query sessions that match the specified criteria. Searching the logs endpoint uses the standard Discovery query syntax for the parameters that are supported.
Searches the query and event log to find query sessions that match the specified criteria. Searching the logs endpoint uses the standard Discovery query syntax for the parameters that are supported.
GET /v1/logs
ServiceCall<LogQueryResponse> queryLog(QueryLogOptions queryLogOptions)
queryLog(params)
query_log(
self,
*,
filter: str = None,
query: str = None,
count: int = None,
offset: int = None,
sort: List[str] = None,
**kwargs,
) -> DetailedResponse
QueryLog(string filter = null, string query = null, long? count = null, long? offset = null, List<string> sort = null)
Request
Use the QueryLogOptions.Builder
to create a QueryLogOptions
object that contains the parameter values for the queryLog
method.
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.
Number of results to return. The maximum for the count and offset values together in any one query is 10000
Default:
10
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified.
The queryLog options.
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.
Number of results to return. The maximum for the count and offset values together in any one query is 10000.
Default:
10
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified.
parameters
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.
Number of results to return. The maximum for the count and offset values together in any one query is 10000.
Default:
10
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified.
parameters
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.
Number of results to return. The maximum for the count and offset values together in any one query is 10000.
Default:
10
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified.
parameters
A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.
A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.
Number of results to return. The maximum for the count and offset values together in any one query is 10000.
Default:
10
The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000.
A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with
-
for descending or+
for ascending. Ascending is the default sort direction if no prefix is specified.
curl -u "apikey":"{apikey}" "{url}/v1/logs?version=2019-04-30&query=test&count=5"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.QueryLog(); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); LogQueryResponse response = discovery.queryLog().execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); discovery.queryLog() .then(logQueryResponse => { console.log(JSON.stringify(logQueryResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Object containing results that match the requested logs query.
Number of matching results.
Array of log query response results.
Object containing results that match the requested logs query.
Number of matching results.
Array of log query response results.
- results
The environment ID that is associated with this log entry.
The customer_id label that was specified in the header of the query or event API call that corresponds to this log entry.
The type of log entry returned.
query indicates that the log represents the results of a call to the single collection query method.
event indicates that the log represents a call to the events API.
Possible values: [
query
,event
]The value of the natural_language_query query parameter that was used to create these results. Only returned with logs of type query.
Note: Other query parameters (such as filter or deduplicate) might have been used with this query, but are not recorded.
Object containing result information that was returned by the query used to create this log entry. Only returned with logs of type
query
.- documentResults
Array of log query response results.
- results
The result rank of this document. A position of
1
indicates that it was the first returned result.The document_id of the document that this result represents.
The raw score of this result. A higher score indicates a greater match to the query parameters.
The confidence score of the result's analysis. A higher score indicating greater confidence.
The collection_id of the document represented by this result.
The number of results returned in the query associate with this log.
Date that the log result was created. Returned in
YYYY-MM-DDThh:mm:ssZ
format.Date specified by the user when recording an event. Returned in
YYYY-MM-DDThh:mm:ssZ
format. Only returned with logs of type event.Identifier that corresponds to the natural_language_query string used in the original or associated query. All event and query log entries that have the same original natural_language_query string also have them same query_id. This field can be used to recall all event and query log results that have the same original query (event logs do not contain the original natural_language_query field).
Unique identifier (within a 24-hour period) that identifies a single
query
log and anyevent
logs that were created for it.Note: If the exact same query is run at the exact same time on different days, the session_token for those queries might be identical. However, the created_timestamp differs.
Note: Session tokens are case sensitive. To avoid matching on session tokens that are identical except for case, use the exact match operator (
::
) when you query for a specific session token.The collection ID of the document associated with this event. Only returned with logs of type
event
.The original display rank of the document associated with this event. Only returned with logs of type
event
.The document ID of the document associated with this event. Only returned with logs of type
event
.The type of event that this object respresents. Possible values are
-
query
the log of a query to a collection -
click
the result of a call to the events endpoint.
Possible values: [
click
,query
]-
The type of result that this event is associated with. Only returned with logs of type
event
.Possible values: [
document
]
Object containing results that match the requested logs query.
Number of matching results.
Array of log query response results.
- results
The environment ID that is associated with this log entry.
The customer_id label that was specified in the header of the query or event API call that corresponds to this log entry.
The type of log entry returned.
query indicates that the log represents the results of a call to the single collection query method.
event indicates that the log represents a call to the events API.
Possible values: [
query
,event
]The value of the natural_language_query query parameter that was used to create these results. Only returned with logs of type query.
Note: Other query parameters (such as filter or deduplicate) might have been used with this query, but are not recorded.
Object containing result information that was returned by the query used to create this log entry. Only returned with logs of type
query
.- document_results
Array of log query response results.
- results
The result rank of this document. A position of
1
indicates that it was the first returned result.The document_id of the document that this result represents.
The raw score of this result. A higher score indicates a greater match to the query parameters.
The confidence score of the result's analysis. A higher score indicating greater confidence.
The collection_id of the document represented by this result.
The number of results returned in the query associate with this log.
Date that the log result was created. Returned in
YYYY-MM-DDThh:mm:ssZ
format.Date specified by the user when recording an event. Returned in
YYYY-MM-DDThh:mm:ssZ
format. Only returned with logs of type event.Identifier that corresponds to the natural_language_query string used in the original or associated query. All event and query log entries that have the same original natural_language_query string also have them same query_id. This field can be used to recall all event and query log results that have the same original query (event logs do not contain the original natural_language_query field).
Unique identifier (within a 24-hour period) that identifies a single
query
log and anyevent
logs that were created for it.Note: If the exact same query is run at the exact same time on different days, the session_token for those queries might be identical. However, the created_timestamp differs.
Note: Session tokens are case sensitive. To avoid matching on session tokens that are identical except for case, use the exact match operator (
::
) when you query for a specific session token.The collection ID of the document associated with this event. Only returned with logs of type
event
.The original display rank of the document associated with this event. Only returned with logs of type
event
.The document ID of the document associated with this event. Only returned with logs of type
event
.The type of event that this object respresents. Possible values are
-
query
the log of a query to a collection -
click
the result of a call to the events endpoint.
Possible values: [
click
,query
]-
The type of result that this event is associated with. Only returned with logs of type
event
.Possible values: [
document
]
Object containing results that match the requested logs query.
Number of matching results.
Array of log query response results.
- results
The environment ID that is associated with this log entry.
The customer_id label that was specified in the header of the query or event API call that corresponds to this log entry.
The type of log entry returned.
query indicates that the log represents the results of a call to the single collection query method.
event indicates that the log represents a call to the events API.
Possible values: [
query
,event
]The value of the natural_language_query query parameter that was used to create these results. Only returned with logs of type query.
Note: Other query parameters (such as filter or deduplicate) might have been used with this query, but are not recorded.
Object containing result information that was returned by the query used to create this log entry. Only returned with logs of type
query
.- document_results
Array of log query response results.
- results
The result rank of this document. A position of
1
indicates that it was the first returned result.The document_id of the document that this result represents.
The raw score of this result. A higher score indicates a greater match to the query parameters.
The confidence score of the result's analysis. A higher score indicating greater confidence.
The collection_id of the document represented by this result.
The number of results returned in the query associate with this log.
Date that the log result was created. Returned in
YYYY-MM-DDThh:mm:ssZ
format.Date specified by the user when recording an event. Returned in
YYYY-MM-DDThh:mm:ssZ
format. Only returned with logs of type event.Identifier that corresponds to the natural_language_query string used in the original or associated query. All event and query log entries that have the same original natural_language_query string also have them same query_id. This field can be used to recall all event and query log results that have the same original query (event logs do not contain the original natural_language_query field).
Unique identifier (within a 24-hour period) that identifies a single
query
log and anyevent
logs that were created for it.Note: If the exact same query is run at the exact same time on different days, the session_token for those queries might be identical. However, the created_timestamp differs.
Note: Session tokens are case sensitive. To avoid matching on session tokens that are identical except for case, use the exact match operator (
::
) when you query for a specific session token.The collection ID of the document associated with this event. Only returned with logs of type
event
.The original display rank of the document associated with this event. Only returned with logs of type
event
.The document ID of the document associated with this event. Only returned with logs of type
event
.The type of event that this object respresents. Possible values are
-
query
the log of a query to a collection -
click
the result of a call to the events endpoint.
Possible values: [
click
,query
]-
The type of result that this event is associated with. Only returned with logs of type
event
.Possible values: [
document
]
Object containing results that match the requested logs query.
Number of matching results.
Array of log query response results.
- Results
The environment ID that is associated with this log entry.
The customer_id label that was specified in the header of the query or event API call that corresponds to this log entry.
The type of log entry returned.
query indicates that the log represents the results of a call to the single collection query method.
event indicates that the log represents a call to the events API.
Possible values: [
query
,event
]The value of the natural_language_query query parameter that was used to create these results. Only returned with logs of type query.
Note: Other query parameters (such as filter or deduplicate) might have been used with this query, but are not recorded.
Object containing result information that was returned by the query used to create this log entry. Only returned with logs of type
query
.- DocumentResults
Array of log query response results.
- Results
The result rank of this document. A position of
1
indicates that it was the first returned result.The document_id of the document that this result represents.
The raw score of this result. A higher score indicates a greater match to the query parameters.
The confidence score of the result's analysis. A higher score indicating greater confidence.
The collection_id of the document represented by this result.
The number of results returned in the query associate with this log.
Date that the log result was created. Returned in
YYYY-MM-DDThh:mm:ssZ
format.Date specified by the user when recording an event. Returned in
YYYY-MM-DDThh:mm:ssZ
format. Only returned with logs of type event.Identifier that corresponds to the natural_language_query string used in the original or associated query. All event and query log entries that have the same original natural_language_query string also have them same query_id. This field can be used to recall all event and query log results that have the same original query (event logs do not contain the original natural_language_query field).
Unique identifier (within a 24-hour period) that identifies a single
query
log and anyevent
logs that were created for it.Note: If the exact same query is run at the exact same time on different days, the session_token for those queries might be identical. However, the created_timestamp differs.
Note: Session tokens are case sensitive. To avoid matching on session tokens that are identical except for case, use the exact match operator (
::
) when you query for a specific session token.The collection ID of the document associated with this event. Only returned with logs of type
event
.The original display rank of the document associated with this event. Only returned with logs of type
event
.The document ID of the document associated with this event. Only returned with logs of type
event
.The type of event that this object respresents. Possible values are
-
query
the log of a query to a collection -
click
the result of a call to the events endpoint.
Possible values: [
click
,query
]-
The type of result that this event is associated with. Only returned with logs of type
event
.Possible values: [
document
]
Status Code
Log query executed successfully.
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
No Sample Response
Number of queries over time
Total number of queries using the natural_language_query parameter over a specific time window.
Total number of queries using the natural_language_query parameter over a specific time window.
Total number of queries using the natural_language_query parameter over a specific time window.
Total number of queries using the natural_language_query parameter over a specific time window.
Total number of queries using the natural_language_query parameter over a specific time window.
GET /v1/metrics/number_of_queries
ServiceCall<MetricResponse> getMetricsQuery(GetMetricsQueryOptions getMetricsQueryOptions)
getMetricsQuery(params)
get_metrics_query(
self,
*,
start_time: datetime = None,
end_time: datetime = None,
result_type: str = None,
**kwargs,
) -> DetailedResponse
GetMetricsQuery(DateTime? startTime = null, DateTime? endTime = null, string resultType = null)
Request
Use the GetMetricsQueryOptions.Builder
to create a GetMetricsQueryOptions
object that contains the parameter values for the getMetricsQuery
method.
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.Metric is computed from data recorded after this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.Metric is computed from data recorded before this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.The type of result to consider when calculating the metric.
Allowable values: [
document
]
The getMetricsQuery options.
Metric is computed from data recorded after this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.Metric is computed from data recorded before this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.The type of result to consider when calculating the metric.
Allowable values: [
document
]
parameters
Metric is computed from data recorded after this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.Metric is computed from data recorded before this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.The type of result to consider when calculating the metric.
Allowable values: [
document
]
parameters
Metric is computed from data recorded after this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.Metric is computed from data recorded before this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.The type of result to consider when calculating the metric.
Allowable values: [
document
]
parameters
Metric is computed from data recorded after this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.Metric is computed from data recorded before this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.The type of result to consider when calculating the metric.
Allowable values: [
document
]
curl -u "apikey":"{apikey}" "{url}/v1/metrics/number_of_queries?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.GetMetricsQuery(); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); MetricResponse response = discovery.getMetricsQuery().execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); discovery.getMetricsQuery() .then(metricResponse => { console.log(JSON.stringify(metricResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
The response generated from a call to a metrics method.
Array of metric aggregations.
The response generated from a call to a metrics method.
Array of metric aggregations.
- aggregations
The measurement interval for this metric. Metric intervals are always 1 day (
1d
).The event type associated with this metric result. This field, when present, will always be
click
.Array of metric aggregation query results.
- results
Date in string form representing the start of this interval.
Unix epoch time equivalent of the key_as_string, that represents the start of this interval.
Number of matching results.
The number of queries with associated events divided by the total number of queries for the interval. Only returned with event_rate metrics.
The response generated from a call to a metrics method.
Array of metric aggregations.
- aggregations
The measurement interval for this metric. Metric intervals are always 1 day (
1d
).The event type associated with this metric result. This field, when present, will always be
click
.Array of metric aggregation query results.
- results
Date in string form representing the start of this interval.
Unix epoch time equivalent of the key_as_string, that represents the start of this interval.
Number of matching results.
The number of queries with associated events divided by the total number of queries for the interval. Only returned with event_rate metrics.
The response generated from a call to a metrics method.
Array of metric aggregations.
- aggregations
The measurement interval for this metric. Metric intervals are always 1 day (
1d
).The event type associated with this metric result. This field, when present, will always be
click
.Array of metric aggregation query results.
- results
Date in string form representing the start of this interval.
Unix epoch time equivalent of the key_as_string, that represents the start of this interval.
Number of matching results.
The number of queries with associated events divided by the total number of queries for the interval. Only returned with event_rate metrics.
The response generated from a call to a metrics method.
Array of metric aggregations.
- Aggregations
The measurement interval for this metric. Metric intervals are always 1 day (
1d
).The event type associated with this metric result. This field, when present, will always be
click
.Array of metric aggregation query results.
- Results
Date in string form representing the start of this interval.
Unix epoch time equivalent of the key_as_string, that represents the start of this interval.
Number of matching results.
The number of queries with associated events divided by the total number of queries for the interval. Only returned with event_rate metrics.
Status Code
Metric calculation executed successfully.
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
No Sample Response
Number of queries with an event over time
Total number of queries using the natural_language_query parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the Events API.
Total number of queries using the natural_language_query parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the Events API.
Total number of queries using the natural_language_query parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the Events API.
Total number of queries using the natural_language_query parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the Events API.
Total number of queries using the natural_language_query parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the Events API.
GET /v1/metrics/number_of_queries_with_event
ServiceCall<MetricResponse> getMetricsQueryEvent(GetMetricsQueryEventOptions getMetricsQueryEventOptions)
getMetricsQueryEvent(params)
get_metrics_query_event(
self,
*,
start_time: datetime = None,
end_time: datetime = None,
result_type: str = None,
**kwargs,
) -> DetailedResponse
GetMetricsQueryEvent(DateTime? startTime = null, DateTime? endTime = null, string resultType = null)
Request
Use the GetMetricsQueryEventOptions.Builder
to create a GetMetricsQueryEventOptions
object that contains the parameter values for the getMetricsQueryEvent
method.
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.Metric is computed from data recorded after this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.Metric is computed from data recorded before this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.The type of result to consider when calculating the metric.
Allowable values: [
document
]
The getMetricsQueryEvent options.
Metric is computed from data recorded after this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.Metric is computed from data recorded before this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.The type of result to consider when calculating the metric.
Allowable values: [
document
]
parameters
Metric is computed from data recorded after this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.Metric is computed from data recorded before this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.The type of result to consider when calculating the metric.
Allowable values: [
document
]
parameters
Metric is computed from data recorded after this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.Metric is computed from data recorded before this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.The type of result to consider when calculating the metric.
Allowable values: [
document
]
parameters
Metric is computed from data recorded after this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.Metric is computed from data recorded before this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.The type of result to consider when calculating the metric.
Allowable values: [
document
]
curl -u "apikey":"{apikey}" "{url}/v1/metrics/number_of_queries_with_event?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.GetMetricsQueryEvent(); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); MetricResponse response = discovery.getMetricsQueryEvent().execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); discovery.getMetricsQueryEvent() .then(metricResponse => { console.log(JSON.stringify(metricResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
The response generated from a call to a metrics method.
Array of metric aggregations.
The response generated from a call to a metrics method.
Array of metric aggregations.
- aggregations
The measurement interval for this metric. Metric intervals are always 1 day (
1d
).The event type associated with this metric result. This field, when present, will always be
click
.Array of metric aggregation query results.
- results
Date in string form representing the start of this interval.
Unix epoch time equivalent of the key_as_string, that represents the start of this interval.
Number of matching results.
The number of queries with associated events divided by the total number of queries for the interval. Only returned with event_rate metrics.
The response generated from a call to a metrics method.
Array of metric aggregations.
- aggregations
The measurement interval for this metric. Metric intervals are always 1 day (
1d
).The event type associated with this metric result. This field, when present, will always be
click
.Array of metric aggregation query results.
- results
Date in string form representing the start of this interval.
Unix epoch time equivalent of the key_as_string, that represents the start of this interval.
Number of matching results.
The number of queries with associated events divided by the total number of queries for the interval. Only returned with event_rate metrics.
The response generated from a call to a metrics method.
Array of metric aggregations.
- aggregations
The measurement interval for this metric. Metric intervals are always 1 day (
1d
).The event type associated with this metric result. This field, when present, will always be
click
.Array of metric aggregation query results.
- results
Date in string form representing the start of this interval.
Unix epoch time equivalent of the key_as_string, that represents the start of this interval.
Number of matching results.
The number of queries with associated events divided by the total number of queries for the interval. Only returned with event_rate metrics.
The response generated from a call to a metrics method.
Array of metric aggregations.
- Aggregations
The measurement interval for this metric. Metric intervals are always 1 day (
1d
).The event type associated with this metric result. This field, when present, will always be
click
.Array of metric aggregation query results.
- Results
Date in string form representing the start of this interval.
Unix epoch time equivalent of the key_as_string, that represents the start of this interval.
Number of matching results.
The number of queries with associated events divided by the total number of queries for the interval. Only returned with event_rate metrics.
Status Code
Metric calculation executed successfully.
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
No Sample Response
Number of queries with no search results over time
Total number of queries using the natural_language_query parameter that have no results returned over a specified time window.
Total number of queries using the natural_language_query parameter that have no results returned over a specified time window.
Total number of queries using the natural_language_query parameter that have no results returned over a specified time window.
Total number of queries using the natural_language_query parameter that have no results returned over a specified time window.
Total number of queries using the natural_language_query parameter that have no results returned over a specified time window.
GET /v1/metrics/number_of_queries_with_no_search_results
ServiceCall<MetricResponse> getMetricsQueryNoResults(GetMetricsQueryNoResultsOptions getMetricsQueryNoResultsOptions)
getMetricsQueryNoResults(params)
get_metrics_query_no_results(
self,
*,
start_time: datetime = None,
end_time: datetime = None,
result_type: str = None,
**kwargs,
) -> DetailedResponse
GetMetricsQueryNoResults(DateTime? startTime = null, DateTime? endTime = null, string resultType = null)
Request
Use the GetMetricsQueryNoResultsOptions.Builder
to create a GetMetricsQueryNoResultsOptions
object that contains the parameter values for the getMetricsQueryNoResults
method.
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.Metric is computed from data recorded after this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.Metric is computed from data recorded before this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.The type of result to consider when calculating the metric.
Allowable values: [
document
]
The getMetricsQueryNoResults options.
Metric is computed from data recorded after this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.Metric is computed from data recorded before this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.The type of result to consider when calculating the metric.
Allowable values: [
document
]
parameters
Metric is computed from data recorded after this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.Metric is computed from data recorded before this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.The type of result to consider when calculating the metric.
Allowable values: [
document
]
parameters
Metric is computed from data recorded after this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.Metric is computed from data recorded before this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.The type of result to consider when calculating the metric.
Allowable values: [
document
]
parameters
Metric is computed from data recorded after this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.Metric is computed from data recorded before this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.The type of result to consider when calculating the metric.
Allowable values: [
document
]
curl -u "apikey":"{apikey}" "{url}/v1/metrics/number_of_queries_with_no_search_results?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.GetMetricsQueryNoResults(); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); MetricResponse response = discovery.getMetricsQueryNoResults().execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); discovery.getMetricsQueryNoResults() .then(metricResponse => { console.log(JSON.stringify(metricResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
The response generated from a call to a metrics method.
Array of metric aggregations.
The response generated from a call to a metrics method.
Array of metric aggregations.
- aggregations
The measurement interval for this metric. Metric intervals are always 1 day (
1d
).The event type associated with this metric result. This field, when present, will always be
click
.Array of metric aggregation query results.
- results
Date in string form representing the start of this interval.
Unix epoch time equivalent of the key_as_string, that represents the start of this interval.
Number of matching results.
The number of queries with associated events divided by the total number of queries for the interval. Only returned with event_rate metrics.
The response generated from a call to a metrics method.
Array of metric aggregations.
- aggregations
The measurement interval for this metric. Metric intervals are always 1 day (
1d
).The event type associated with this metric result. This field, when present, will always be
click
.Array of metric aggregation query results.
- results
Date in string form representing the start of this interval.
Unix epoch time equivalent of the key_as_string, that represents the start of this interval.
Number of matching results.
The number of queries with associated events divided by the total number of queries for the interval. Only returned with event_rate metrics.
The response generated from a call to a metrics method.
Array of metric aggregations.
- aggregations
The measurement interval for this metric. Metric intervals are always 1 day (
1d
).The event type associated with this metric result. This field, when present, will always be
click
.Array of metric aggregation query results.
- results
Date in string form representing the start of this interval.
Unix epoch time equivalent of the key_as_string, that represents the start of this interval.
Number of matching results.
The number of queries with associated events divided by the total number of queries for the interval. Only returned with event_rate metrics.
The response generated from a call to a metrics method.
Array of metric aggregations.
- Aggregations
The measurement interval for this metric. Metric intervals are always 1 day (
1d
).The event type associated with this metric result. This field, when present, will always be
click
.Array of metric aggregation query results.
- Results
Date in string form representing the start of this interval.
Unix epoch time equivalent of the key_as_string, that represents the start of this interval.
Number of matching results.
The number of queries with associated events divided by the total number of queries for the interval. Only returned with event_rate metrics.
Status Code
Metric calculation executed successfully.
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
No Sample Response
Percentage of queries with an associated event
The percentage of queries using the natural_language_query parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the Events API.
The percentage of queries using the natural_language_query parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the Events API.
The percentage of queries using the natural_language_query parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the Events API.
The percentage of queries using the natural_language_query parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the Events API.
The percentage of queries using the natural_language_query parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the Events API.
GET /v1/metrics/event_rate
ServiceCall<MetricResponse> getMetricsEventRate(GetMetricsEventRateOptions getMetricsEventRateOptions)
getMetricsEventRate(params)
get_metrics_event_rate(
self,
*,
start_time: datetime = None,
end_time: datetime = None,
result_type: str = None,
**kwargs,
) -> DetailedResponse
GetMetricsEventRate(DateTime? startTime = null, DateTime? endTime = null, string resultType = null)
Request
Use the GetMetricsEventRateOptions.Builder
to create a GetMetricsEventRateOptions
object that contains the parameter values for the getMetricsEventRate
method.
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.Metric is computed from data recorded after this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.Metric is computed from data recorded before this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.The type of result to consider when calculating the metric.
Allowable values: [
document
]
The getMetricsEventRate options.
Metric is computed from data recorded after this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.Metric is computed from data recorded before this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.The type of result to consider when calculating the metric.
Allowable values: [
document
]
parameters
Metric is computed from data recorded after this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.Metric is computed from data recorded before this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.The type of result to consider when calculating the metric.
Allowable values: [
document
]
parameters
Metric is computed from data recorded after this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.Metric is computed from data recorded before this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.The type of result to consider when calculating the metric.
Allowable values: [
document
]
parameters
Metric is computed from data recorded after this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.Metric is computed from data recorded before this timestamp; must be in
YYYY-MM-DDThh:mm:ssZ
format.The type of result to consider when calculating the metric.
Allowable values: [
document
]
curl -u "apikey":"{apikey}" "{url}/v1/metrics/event_rate?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.GetMetricsEventRate(); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); MetricResponse response = discovery.getMetricsEventRate().execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); discovery.getMetricsEventRate() .then(metricResponse => { console.log(JSON.stringify(metricResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
The response generated from a call to a metrics method.
Array of metric aggregations.
The response generated from a call to a metrics method.
Array of metric aggregations.
- aggregations
The measurement interval for this metric. Metric intervals are always 1 day (
1d
).The event type associated with this metric result. This field, when present, will always be
click
.Array of metric aggregation query results.
- results
Date in string form representing the start of this interval.
Unix epoch time equivalent of the key_as_string, that represents the start of this interval.
Number of matching results.
The number of queries with associated events divided by the total number of queries for the interval. Only returned with event_rate metrics.
The response generated from a call to a metrics method.
Array of metric aggregations.
- aggregations
The measurement interval for this metric. Metric intervals are always 1 day (
1d
).The event type associated with this metric result. This field, when present, will always be
click
.Array of metric aggregation query results.
- results
Date in string form representing the start of this interval.
Unix epoch time equivalent of the key_as_string, that represents the start of this interval.
Number of matching results.
The number of queries with associated events divided by the total number of queries for the interval. Only returned with event_rate metrics.
The response generated from a call to a metrics method.
Array of metric aggregations.
- aggregations
The measurement interval for this metric. Metric intervals are always 1 day (
1d
).The event type associated with this metric result. This field, when present, will always be
click
.Array of metric aggregation query results.
- results
Date in string form representing the start of this interval.
Unix epoch time equivalent of the key_as_string, that represents the start of this interval.
Number of matching results.
The number of queries with associated events divided by the total number of queries for the interval. Only returned with event_rate metrics.
The response generated from a call to a metrics method.
Array of metric aggregations.
- Aggregations
The measurement interval for this metric. Metric intervals are always 1 day (
1d
).The event type associated with this metric result. This field, when present, will always be
click
.Array of metric aggregation query results.
- Results
Date in string form representing the start of this interval.
Unix epoch time equivalent of the key_as_string, that represents the start of this interval.
Number of matching results.
The number of queries with associated events divided by the total number of queries for the interval. Only returned with event_rate metrics.
Status Code
Metric calculation executed successfully.
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
No Sample Response
Most frequent query tokens with an event
The most frequent query tokens parsed from the natural_language_query parameter and their corresponding "click" event rate within the recording period (queries and events are stored for 30 days). A query token is an individual word or unigram within the query string.
The most frequent query tokens parsed from the natural_language_query parameter and their corresponding "click" event rate within the recording period (queries and events are stored for 30 days). A query token is an individual word or unigram within the query string.
The most frequent query tokens parsed from the natural_language_query parameter and their corresponding "click" event rate within the recording period (queries and events are stored for 30 days). A query token is an individual word or unigram within the query string.
The most frequent query tokens parsed from the natural_language_query parameter and their corresponding "click" event rate within the recording period (queries and events are stored for 30 days). A query token is an individual word or unigram within the query string.
The most frequent query tokens parsed from the natural_language_query parameter and their corresponding "click" event rate within the recording period (queries and events are stored for 30 days). A query token is an individual word or unigram within the query string.
GET /v1/metrics/top_query_tokens_with_event_rate
ServiceCall<MetricTokenResponse> getMetricsQueryTokenEvent(GetMetricsQueryTokenEventOptions getMetricsQueryTokenEventOptions)
getMetricsQueryTokenEvent(params)
get_metrics_query_token_event(
self,
*,
count: int = None,
**kwargs,
) -> DetailedResponse
GetMetricsQueryTokenEvent(long? count = null)
Request
Use the GetMetricsQueryTokenEventOptions.Builder
to create a GetMetricsQueryTokenEventOptions
object that contains the parameter values for the getMetricsQueryTokenEvent
method.
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.Number of results to return. The maximum for the count and offset values together in any one query is 10000
Default:
10
The getMetricsQueryTokenEvent options.
Number of results to return. The maximum for the count and offset values together in any one query is 10000.
Default:
10
parameters
Number of results to return. The maximum for the count and offset values together in any one query is 10000.
Default:
10
parameters
Number of results to return. The maximum for the count and offset values together in any one query is 10000.
Default:
10
parameters
Number of results to return. The maximum for the count and offset values together in any one query is 10000.
Default:
10
curl -u "apikey":"{apikey}" "{url}/v1/metrics/top_query_tokens_with_event_rate?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.GetMetricsQueryTokenEvent(); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); MetricTokenResponse response = discovery.getMetricsQueryTokenEvent().execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); discovery.getMetricsQueryTokenEvent() .then(metricTokenResponse => { console.log(JSON.stringify(metricTokenResponse, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
The response generated from a call to a metrics method that evaluates tokens.
Array of metric token aggregations.
The response generated from a call to a metrics method that evaluates tokens.
Array of metric token aggregations.
- aggregations
The event type associated with this metric result. This field, when present, will always be
click
.Array of results for the metric token aggregation.
- results
The content of the natural_language_query parameter used in the query that this result represents.
Number of matching results.
The number of queries with associated events divided by the total number of queries currently stored (queries and events are stored in the log for 30 days).
The response generated from a call to a metrics method that evaluates tokens.
Array of metric token aggregations.
- aggregations
The event type associated with this metric result. This field, when present, will always be
click
.Array of results for the metric token aggregation.
- results
The content of the natural_language_query parameter used in the query that this result represents.
Number of matching results.
The number of queries with associated events divided by the total number of queries currently stored (queries and events are stored in the log for 30 days).
The response generated from a call to a metrics method that evaluates tokens.
Array of metric token aggregations.
- aggregations
The event type associated with this metric result. This field, when present, will always be
click
.Array of results for the metric token aggregation.
- results
The content of the natural_language_query parameter used in the query that this result represents.
Number of matching results.
The number of queries with associated events divided by the total number of queries currently stored (queries and events are stored in the log for 30 days).
The response generated from a call to a metrics method that evaluates tokens.
Array of metric token aggregations.
- Aggregations
The event type associated with this metric result. This field, when present, will always be
click
.Array of results for the metric token aggregation.
- Results
The content of the natural_language_query parameter used in the query that this result represents.
Number of matching results.
The number of queries with associated events divided by the total number of queries currently stored (queries and events are stored in the log for 30 days).
Status Code
Metric calculation executed successfully.
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
No Sample Response
List credentials
List all the source credentials that have been created for this service instance.
Note: All credentials are sent over an encrypted connection and encrypted at rest.
List all the source credentials that have been created for this service instance.
Note: All credentials are sent over an encrypted connection and encrypted at rest.
List all the source credentials that have been created for this service instance.
Note: All credentials are sent over an encrypted connection and encrypted at rest.
List all the source credentials that have been created for this service instance.
Note: All credentials are sent over an encrypted connection and encrypted at rest.
List all the source credentials that have been created for this service instance.
Note: All credentials are sent over an encrypted connection and encrypted at rest.
GET /v1/environments/{environment_id}/credentials
ServiceCall<CredentialsList> listCredentials(ListCredentialsOptions listCredentialsOptions)
listCredentials(params)
list_credentials(
self,
environment_id: str,
**kwargs,
) -> DetailedResponse
ListCredentials(string environmentId)
Request
Use the ListCredentialsOptions.Builder
to create a ListCredentialsOptions
object that contains the parameter values for the listCredentials
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The listCredentials options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -u "apikey":"{apikey}" -X GET "{url}/v1/environments/{environment_id}/credentials?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.ListCredentials( environmentId: "{environmentId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; ListCredentialsOptions listOptions = new ListCredentialsOptions.Builder() .environmentId(environmentId) .build(); CredentialsList response = discovery.listCredentials(listOptions).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const listCredentialsParams = { environmentId: '{environment_id}', }; discovery.listCredentials(listCredentialsParams) .then(credentialsList => { console.log(JSON.stringify(credentialsList, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Object containing array of credential definitions.
An array of credential definitions that were created for this instance.
Object containing array of credential definitions.
{
"credentials": [
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
"source_type": "salesforce",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "username_password",
"url": "login.salesforce.com",
"username": "user@email.address"
}
},
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f111c",
"source_type": "box",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "oauth2",
"client_id": "1234567899bz7micz6x6p5zfnycw98e3",
"enterprise_id": "000000001"
}
},
{
"credential_id": "00000d8c-0000-00e8-ba22-0ed5f89f999d",
"source_type": "sharepoint",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "saml",
"organization_url": "https://site001.sharepointonline.com",
"site_collection_path": "/sites/TestSite1",
"username": "userA@sharepointonline.com"
}
}
]
}
An array of credential definitions that were created for this instance.
Examples:{ "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b", "source_type": "salesforce", "status": { "authenticated": true }, "credential_details": { "credential_type": "username_password", "url": "login.salesforce.com", "username": "user@email.address" } }
- credentials
Unique identifier for this set of credentials.
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- credentialDetails
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Possible values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Possible values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
Object containing array of credential definitions.
{
"credentials": [
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
"source_type": "salesforce",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "username_password",
"url": "login.salesforce.com",
"username": "user@email.address"
}
},
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f111c",
"source_type": "box",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "oauth2",
"client_id": "1234567899bz7micz6x6p5zfnycw98e3",
"enterprise_id": "000000001"
}
},
{
"credential_id": "00000d8c-0000-00e8-ba22-0ed5f89f999d",
"source_type": "sharepoint",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "saml",
"organization_url": "https://site001.sharepointonline.com",
"site_collection_path": "/sites/TestSite1",
"username": "userA@sharepointonline.com"
}
}
]
}
An array of credential definitions that were created for this instance.
Examples:{ "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b", "source_type": "salesforce", "status": { "authenticated": true }, "credential_details": { "credential_type": "username_password", "url": "login.salesforce.com", "username": "user@email.address" } }
- credentials
Unique identifier for this set of credentials.
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- credential_details
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Possible values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Possible values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
Object containing array of credential definitions.
{
"credentials": [
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
"source_type": "salesforce",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "username_password",
"url": "login.salesforce.com",
"username": "user@email.address"
}
},
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f111c",
"source_type": "box",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "oauth2",
"client_id": "1234567899bz7micz6x6p5zfnycw98e3",
"enterprise_id": "000000001"
}
},
{
"credential_id": "00000d8c-0000-00e8-ba22-0ed5f89f999d",
"source_type": "sharepoint",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "saml",
"organization_url": "https://site001.sharepointonline.com",
"site_collection_path": "/sites/TestSite1",
"username": "userA@sharepointonline.com"
}
}
]
}
An array of credential definitions that were created for this instance.
Examples:{ "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b", "source_type": "salesforce", "status": { "authenticated": true }, "credential_details": { "credential_type": "username_password", "url": "login.salesforce.com", "username": "user@email.address" } }
- credentials
Unique identifier for this set of credentials.
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- credential_details
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Possible values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Possible values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
Object containing array of credential definitions.
{
"credentials": [
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
"source_type": "salesforce",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "username_password",
"url": "login.salesforce.com",
"username": "user@email.address"
}
},
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f111c",
"source_type": "box",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "oauth2",
"client_id": "1234567899bz7micz6x6p5zfnycw98e3",
"enterprise_id": "000000001"
}
},
{
"credential_id": "00000d8c-0000-00e8-ba22-0ed5f89f999d",
"source_type": "sharepoint",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "saml",
"organization_url": "https://site001.sharepointonline.com",
"site_collection_path": "/sites/TestSite1",
"username": "userA@sharepointonline.com"
}
}
]
}
An array of credential definitions that were created for this instance.
Examples:{ "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b", "source_type": "salesforce", "status": { "authenticated": true }, "credential_details": { "credential_type": "username_password", "url": "login.salesforce.com", "username": "user@email.address" } }
- Credentials
Unique identifier for this set of credentials.
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- CredentialDetails
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Possible values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Possible values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- Status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
Status Code
The request to list all credentials completed successfully.
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
{ "credentials": [ { "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b", "source_type": "salesforce", "status": { "authenticated": true }, "credential_details": { "credential_type": "username_password", "url": "login.salesforce.com", "username": "user@email.address" } }, { "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f111c", "source_type": "box", "status": { "authenticated": true }, "credential_details": { "credential_type": "oauth2", "client_id": "1234567899bz7micz6x6p5zfnycw98e3", "enterprise_id": "000000001" } }, { "credential_id": "00000d8c-0000-00e8-ba22-0ed5f89f999d", "source_type": "sharepoint", "status": { "authenticated": true }, "credential_details": { "credential_type": "saml", "organization_url": "https://site001.sharepointonline.com", "site_collection_path": "/sites/TestSite1", "username": "userA@sharepointonline.com" } } ] }
{ "credentials": [ { "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b", "source_type": "salesforce", "status": { "authenticated": true }, "credential_details": { "credential_type": "username_password", "url": "login.salesforce.com", "username": "user@email.address" } }, { "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f111c", "source_type": "box", "status": { "authenticated": true }, "credential_details": { "credential_type": "oauth2", "client_id": "1234567899bz7micz6x6p5zfnycw98e3", "enterprise_id": "000000001" } }, { "credential_id": "00000d8c-0000-00e8-ba22-0ed5f89f999d", "source_type": "sharepoint", "status": { "authenticated": true }, "credential_details": { "credential_type": "saml", "organization_url": "https://site001.sharepointonline.com", "site_collection_path": "/sites/TestSite1", "username": "userA@sharepointonline.com" } } ] }
Create credentials
Creates a set of credentials to connect to a remote source. Created credentials are used in a configuration to associate a collection with the remote source.
Note: All credentials are sent over an encrypted connection and encrypted at rest.
Creates a set of credentials to connect to a remote source. Created credentials are used in a configuration to associate a collection with the remote source.
Note: All credentials are sent over an encrypted connection and encrypted at rest.
Creates a set of credentials to connect to a remote source. Created credentials are used in a configuration to associate a collection with the remote source.
Note: All credentials are sent over an encrypted connection and encrypted at rest.
Creates a set of credentials to connect to a remote source. Created credentials are used in a configuration to associate a collection with the remote source.
Note: All credentials are sent over an encrypted connection and encrypted at rest.
Creates a set of credentials to connect to a remote source. Created credentials are used in a configuration to associate a collection with the remote source.
Note: All credentials are sent over an encrypted connection and encrypted at rest.
POST /v1/environments/{environment_id}/credentials
ServiceCall<Credentials> createCredentials(CreateCredentialsOptions createCredentialsOptions)
createCredentials(params)
create_credentials(
self,
environment_id: str,
*,
source_type: str = None,
credential_details: 'CredentialDetails' = None,
status: 'StatusDetails' = None,
**kwargs,
) -> DetailedResponse
CreateCredentials(string environmentId, string sourceType = null, CredentialDetails credentialDetails = null, StatusDetails status = null)
Request
Use the CreateCredentialsOptions.Builder
to create a CreateCredentialsOptions
object that contains the parameter values for the createCredentials
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
An object that defines an individual set of source credentials.
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
"source_type": "salesforce",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "username_password",
"url": "login.salesforce.com",
"username": "user@email.address"
}
}
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Allowable values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
Object that contains details about the status of the authentication process.
The createCredentials options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Allowable values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- credentialDetails
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Allowable values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Allowable values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Allowable values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- credentialDetails
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Allowable values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Allowable values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Allowable values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- credential_details
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Allowable values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Allowable values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Allowable values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- credentialDetails
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Allowable values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Allowable values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
curl -u "apikey":"{apikey}" -X POST -H "Content-Type: application/json" -d '{ "source_type": "salesforce", "credential_details": { "credential_type": "username_password", "url": "login.salesforce.com", "username": "email@server.xyz", "password": "{my_salesforce_password}{my_salesforce_security_token}"}}' "{url}/v1/environments/{environment_id}/credentials?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var credentialDetails = new CredentialDetails() { CredentialType = "{credentialType}", EnterpriseId = "{EnterpriseId}", ClientId = "{ClientId}", ClientSecret = "{ClientSecret}", PublicKeyId = "{PublicKeyId}", Passphrase = "{Passphrase}", PrivateKey = "{PrivateKey}" }; var result = discovery.CreateCredentials( environmentId: "{environmentId}", sourceType: "{sourceType}", credentialDetails: credentialDetails ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String credentialType = "username_password"; String url = "https://login.salesforce.com"; String username = "test@username.com"; String password = "test_password"; String sourceType = "salesforce"; CredentialDetails credentialDetails = new CredentialDetails(); credentialDetails.setCredentialType(credentialType); credentialDetails.setUrl(url); credentialDetails.setUsername(username); credentialDetails.setPassword(password); Credentials credentials = new Credentials(); credentials.setSourceType(sourceType); credentials.setCredentialDetails(credentialDetails); CreateCredentialsOptions createOptions = new CreateCredentialsOptions.Builder() .environmentId(environmentId) .credentials(credentials) .build(); Credentials response = discovery.createCredentials(createOptions).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const createCredentialsParams = { environmentId: '{environment_id}', sourceType: 'sharepoint', credentialDetails: { credential_type: 'saml', username: 'myUserName', password: 'pass1234', organization_url: 'www.sharepoint-org.com/organization', }, }; discovery.createCredentials(createCredentialsParams) .then(credentials => { console.log(JSON.stringify(credentials, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Object containing credential information.
Unique identifier for this set of credentials.
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
Object that contains details about the status of the authentication process.
Object containing credential information.
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
"source_type": "salesforce",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "username_password",
"url": "login.salesforce.com",
"username": "user@email.address"
}
}
Unique identifier for this set of credentials.
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- credentialDetails
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Possible values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Possible values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
Object containing credential information.
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
"source_type": "salesforce",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "username_password",
"url": "login.salesforce.com",
"username": "user@email.address"
}
}
Unique identifier for this set of credentials.
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- credential_details
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Possible values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Possible values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
Object containing credential information.
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
"source_type": "salesforce",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "username_password",
"url": "login.salesforce.com",
"username": "user@email.address"
}
}
Unique identifier for this set of credentials.
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- credential_details
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Possible values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Possible values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
Object containing credential information.
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
"source_type": "salesforce",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "username_password",
"url": "login.salesforce.com",
"username": "user@email.address"
}
}
Unique identifier for this set of credentials.
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- CredentialDetails
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Possible values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Possible values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- Status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
Status Code
Credentials successfully created.
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
{ "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b", "source_type": "salesforce", "status": { "authenticated": true }, "credential_details": { "credential_type": "username_password", "url": "login.salesforce.com", "username": "user@email.address" } }
{ "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b", "source_type": "salesforce", "status": { "authenticated": true }, "credential_details": { "credential_type": "username_password", "url": "login.salesforce.com", "username": "user@email.address" } }
View Credentials
Returns details about the specified credentials.
Note: Secure credential information such as a password or SSH key is never returned and must be obtained from the source system.
Returns details about the specified credentials.
Note: Secure credential information such as a password or SSH key is never returned and must be obtained from the source system.
Returns details about the specified credentials.
Note: Secure credential information such as a password or SSH key is never returned and must be obtained from the source system.
Returns details about the specified credentials.
Note: Secure credential information such as a password or SSH key is never returned and must be obtained from the source system.
Returns details about the specified credentials.
Note: Secure credential information such as a password or SSH key is never returned and must be obtained from the source system.
GET /v1/environments/{environment_id}/credentials/{credential_id}
ServiceCall<Credentials> getCredentials(GetCredentialsOptions getCredentialsOptions)
getCredentials(params)
get_credentials(
self,
environment_id: str,
credential_id: str,
**kwargs,
) -> DetailedResponse
GetCredentials(string environmentId, string credentialId)
Request
Use the GetCredentialsOptions.Builder
to create a GetCredentialsOptions
object that contains the parameter values for the getCredentials
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The unique identifier for a set of source credentials.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The getCredentials options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The unique identifier for a set of source credentials.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The unique identifier for a set of source credentials.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The unique identifier for a set of source credentials.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The unique identifier for a set of source credentials.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -u "apikey":"{apikey}" -X GET "{url}/v1/environments/{environment_id}/credentials/{credential_id}?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.GetCredentials( environmentId: "{environmentId}", credentialId: "{credentialId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String credentialId = "{credential_id}"; GetCredentialsOptions getOptions = new GetCredentialsOptions.Builder() .environmentId(environmentId) .credentialId(credentialId) .build(); Credentials response = discovery.getCredentials(getOptions).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const getCredentialsParams = { environmentId: '{environment_id}', credentialId: '{credential_id}', }; discovery.getCredentials(getCredentialsParams) .then(credentials => { console.log(JSON.stringify(credentials, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Object containing credential information.
Unique identifier for this set of credentials.
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
Object that contains details about the status of the authentication process.
Object containing credential information.
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
"source_type": "salesforce",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "username_password",
"url": "login.salesforce.com",
"username": "user@email.address"
}
}
Unique identifier for this set of credentials.
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- credentialDetails
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Possible values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Possible values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
Object containing credential information.
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
"source_type": "salesforce",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "username_password",
"url": "login.salesforce.com",
"username": "user@email.address"
}
}
Unique identifier for this set of credentials.
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- credential_details
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Possible values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Possible values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
Object containing credential information.
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
"source_type": "salesforce",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "username_password",
"url": "login.salesforce.com",
"username": "user@email.address"
}
}
Unique identifier for this set of credentials.
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- credential_details
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Possible values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Possible values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
Object containing credential information.
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
"source_type": "salesforce",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "username_password",
"url": "login.salesforce.com",
"username": "user@email.address"
}
}
Unique identifier for this set of credentials.
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- CredentialDetails
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Possible values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Possible values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- Status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
Status Code
The requested credentials object was successfully returned.
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
{ "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b", "source_type": "salesforce", "status": { "authenticated": true }, "credential_details": { "credential_type": "username_password", "url": "login.salesforce.com", "username": "user@email.address" } }
{ "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b", "source_type": "salesforce", "status": { "authenticated": true }, "credential_details": { "credential_type": "username_password", "url": "login.salesforce.com", "username": "user@email.address" } }
Update credentials
Updates an existing set of source credentials.
Note: All credentials are sent over an encrypted connection and encrypted at rest.
Updates an existing set of source credentials.
Note: All credentials are sent over an encrypted connection and encrypted at rest.
Updates an existing set of source credentials.
Note: All credentials are sent over an encrypted connection and encrypted at rest.
Updates an existing set of source credentials.
Note: All credentials are sent over an encrypted connection and encrypted at rest.
Updates an existing set of source credentials.
Note: All credentials are sent over an encrypted connection and encrypted at rest.
PUT /v1/environments/{environment_id}/credentials/{credential_id}
ServiceCall<Credentials> updateCredentials(UpdateCredentialsOptions updateCredentialsOptions)
updateCredentials(params)
update_credentials(
self,
environment_id: str,
credential_id: str,
*,
source_type: str = None,
credential_details: 'CredentialDetails' = None,
status: 'StatusDetails' = None,
**kwargs,
) -> DetailedResponse
UpdateCredentials(string environmentId, string credentialId, string sourceType = null, CredentialDetails credentialDetails = null, StatusDetails status = null)
Request
Use the UpdateCredentialsOptions.Builder
to create a UpdateCredentialsOptions
object that contains the parameter values for the updateCredentials
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The unique identifier for a set of source credentials.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
An object that defines an individual set of source credentials.
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
"source_type": "salesforce",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "username_password",
"url": "login.salesforce.com",
"username": "user@email.address"
}
}
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Allowable values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
Object that contains details about the status of the authentication process.
The updateCredentials options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The unique identifier for a set of source credentials.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Allowable values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- credentialDetails
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Allowable values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Allowable values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The unique identifier for a set of source credentials.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Allowable values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- credentialDetails
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Allowable values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Allowable values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The unique identifier for a set of source credentials.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Allowable values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- credential_details
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Allowable values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Allowable values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The unique identifier for a set of source credentials.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Allowable values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- credentialDetails
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Allowable values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Allowable values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
curl -u "apikey":"{apikey}" -X PUT -H "Content-Type: application/json" -d '{ "source_type": "salesforce", "credential_details": { "credential_type": "username_password", "url": "login.salesforce.com", "username": "email@server.xyz", "password": "my_salesforce_passwordmy_salesforce_security_token"}}' "{url}/v1/environments/{environment_id}/credentials/{credential_id}?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); string privateKey = "{privatekey}"; var privateKeyBytes = System.Text.Encoding.UTF8.GetBytes(privateKey); var base64PrivateKey = Convert.ToBase64String(privateKeyBytes); var updatedCredentialDetails = new CredentialDetails() { CredentialType = "{credentialType}", EnterpriseId = "{EnterpriseId}", ClientId = "{ClientId}", ClientSecret = "{ClientSecret}", PublicKeyId = "{PublicKeyId}", Passphrase = "{Passphrase}", PrivateKey = "{PrivateKey}" }; var result = discovery.UpdateCredentials( environmentId: "{environmentId}", credentialId: "{credentialId}", sourceType: "{sourceType}", credentialDetails: updatedCredentialDetails ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String credentialId = "{credential_id}"; String credentialType = "username_password"; String oldUsername = "test@username.com"; String oldPassword = "test_password"; String newUrl = "https://newlogin.salesforce.com"; String sourceType = "salesforce"; CredentialDetails updatedDetails = new CredentialDetails(); updatedDetails.setCredentialType(credentialType); updatedDetails.setUrl(newUrl); updatedDetails.setUsername(oldUsername); updatedDetails.setPassword(oldPassword); UpdateCredentialsOptions updateOptions = new UpdateCredentialsOptions.Builder() .environmentId(environmentId) .credentialId(credentialId) .sourceType(sourceType) .credentialDetails(updatedDetails) .build(); Credentials response = discovery.updateCredentials(updateOptions).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const updateCredentialsParams = { environmentId: '{environment_id}', credentialId: '{credential_id}', sourceType: 'sharepoint', credentialDetails: { credential_type: 'saml', username: 'new username', password: 'new password', organization_url: 'www.sharepoint-org.com/organization', }, }; discovery.updateCredentials(updateCredentialsParams) .then(credentials => { console.log(JSON.stringify(credentials, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Object containing credential information.
Unique identifier for this set of credentials.
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
Object that contains details about the status of the authentication process.
Object containing credential information.
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
"source_type": "salesforce",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "username_password",
"url": "login.salesforce.com",
"username": "user@email.address"
}
}
Unique identifier for this set of credentials.
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- credentialDetails
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Possible values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Possible values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
Object containing credential information.
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
"source_type": "salesforce",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "username_password",
"url": "login.salesforce.com",
"username": "user@email.address"
}
}
Unique identifier for this set of credentials.
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- credential_details
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Possible values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Possible values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
Object containing credential information.
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
"source_type": "salesforce",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "username_password",
"url": "login.salesforce.com",
"username": "user@email.address"
}
}
Unique identifier for this set of credentials.
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- credential_details
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Possible values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Possible values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
Object containing credential information.
{
"credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
"source_type": "salesforce",
"status": {
"authenticated": true
},
"credential_details": {
"credential_type": "username_password",
"url": "login.salesforce.com",
"username": "user@email.address"
}
}
Unique identifier for this set of credentials.
The source that this credentials object connects to.
box
indicates the credentials are used to connect an instance of Enterprise Box.salesforce
indicates the credentials are used to connect to Salesforce.sharepoint
indicates the credentials are used to connect to Microsoft SharePoint Online.web_crawl
indicates the credentials are used to perform a web crawl. =cloud_object_storage
indicates the credentials are used to connect to an IBM Cloud Object Store.
Possible values: [
box
,salesforce
,sharepoint
,web_crawl
,cloud_object_storage
]Object containing details of the stored credentials.
Obtain credentials for your source from the administrator of the source.
- CredentialDetails
The authentication method for this credentials definition. The credential_type specified must be supported by the source_type. The following combinations are possible:
"source_type": "box"
- validcredential_type
s:oauth2
"source_type": "salesforce"
- validcredential_type
s:username_password
"source_type": "sharepoint"
- validcredential_type
s:saml
with source_version ofonline
, orntlm_v1
with source_version of2016
"source_type": "web_crawl"
- validcredential_type
s:noauth
orbasic
- "source_type": "cloud_object_storage"
- valid
credential_types:
aws4_hmac`.
Possible values: [
oauth2
,saml
,username_password
,noauth
,basic
,ntlm_v1
,aws4_hmac
]The client_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
.The enterprise_id of the Box site that these credentials connect to. Only valid, and required, with a source_type of
box
.The url of the source that these credentials connect to. Only valid, and required, with a credential_type of
username_password
,noauth
, andbasic
.The username of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
,username_password
,basic
, orntlm_v1
.The organization_url of the source that these credentials connect to. Only valid, and required, with a credential_type of
saml
.The site_collection.path of the source that these credentials connect to. Only valid, and required, with a source_type of
sharepoint
.The client_secret of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The public_key_id of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The private_key of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The passphrase of the source that these credentials connect to. Only valid, and required, with a credential_type of
oauth2
. This value is never returned and is only used when creating or modifying credentials.The password of the source that these credentials connect to. Only valid, and required, with credential_types of
saml
,username_password
,basic
, orntlm_v1
.Note: When used with a source_type of
salesforce
, the password consists of the Salesforce password and a valid Salesforce security token concatenated. This value is never returned and is only used when creating or modifying credentials.The ID of the gateway to be connected through (when connecting to intranet sites). Only valid with a credential_type of
noauth
,basic
, orntlm_v1
. Gateways are created using the/v1/environments/{environment_id}/gateways
methods.The type of Sharepoint repository to connect to. Only valid, and required, with a source_type of
sharepoint
.Possible values: [
online
,2016
]SharePoint OnPrem WebApplication URL. Only valid, and required, with a source_version of
2016
. If a port is not supplied, the default to port80
for http and port443
for https connections are used.The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with a source_version of
2016
.The endpoint associated with the cloud object store that your are connecting to. Only valid, and required, with a credential_type of
aws4_hmac
.The access key ID associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.The secret access key associated with the cloud object store. Only valid, and required, with a credential_type of
aws4_hmac
. This value is never returned and is only used when creating or modifying credentials. For more infomation, see the cloud object store documentation.
Object that contains details about the status of the authentication process.
- Status
Indicates whether the credential is accepted by the target data source.
If
authenticated
isfalse
, a message describes why authentication is unsuccessful.
Status Code
Credentials successfully updated.
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
Authentication to source failed. The error message contains details about what caused the request to be rejected.
Not found. The error message contains details about what caused the request to be rejected.
{ "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b", "source_type": "salesforce", "status": { "authenticated": true }, "credential_details": { "credential_type": "username_password", "url": "login.salesforce.com", "username": "user@email.address" } }
{ "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b", "source_type": "salesforce", "status": { "authenticated": true }, "credential_details": { "credential_type": "username_password", "url": "login.salesforce.com", "username": "user@email.address" } }
Delete credentials
Deletes a set of stored credentials from your Discovery instance.
Deletes a set of stored credentials from your Discovery instance.
Deletes a set of stored credentials from your Discovery instance.
Deletes a set of stored credentials from your Discovery instance.
Deletes a set of stored credentials from your Discovery instance.
DELETE /v1/environments/{environment_id}/credentials/{credential_id}
ServiceCall<DeleteCredentials> deleteCredentials(DeleteCredentialsOptions deleteCredentialsOptions)
deleteCredentials(params)
delete_credentials(
self,
environment_id: str,
credential_id: str,
**kwargs,
) -> DetailedResponse
DeleteCredentials(string environmentId, string credentialId)
Request
Use the DeleteCredentialsOptions.Builder
to create a DeleteCredentialsOptions
object that contains the parameter values for the deleteCredentials
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The unique identifier for a set of source credentials.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The deleteCredentials options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The unique identifier for a set of source credentials.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The unique identifier for a set of source credentials.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The unique identifier for a set of source credentials.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The unique identifier for a set of source credentials.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -u "apikey":"{apikey}" -X DELETE "{url}/v1/environments/{environment_id}/credentials/{credential_id}?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.DeleteCredentials( environmentId: "{environmentId}", credentialId: "{credentialId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String credentialId = "{credential_id}"; DeleteCredentialsOptions deleteOptions = new DeleteCredentialsOptions.Builder() .environmentId(environmentId) .credentialId(credentialId) .build(); DeleteCredentials response = discovery.deleteCredentials(deleteOptions).execute();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const deleteCredentialsParams = { environmentId: '{environment_id}', credentialId: '{credential_id}', }; discovery.deleteCredentials(deleteCredentialsParams) .then(deleteCredentials => { console.log(JSON.stringify(deleteCredentials, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Object returned after credentials are deleted.
The unique identifier of the credentials that have been deleted.
The status of the deletion request.
Possible values: [
deleted
]
Object returned after credentials are deleted.
The unique identifier of the credentials that have been deleted.
The status of the deletion request.
Possible values: [
deleted
]
Object returned after credentials are deleted.
The unique identifier of the credentials that have been deleted.
The status of the deletion request.
Possible values: [
deleted
]
Object returned after credentials are deleted.
The unique identifier of the credentials that have been deleted.
The status of the deletion request.
Possible values: [
deleted
]
Object returned after credentials are deleted.
The unique identifier of the credentials that have been deleted.
The status of the deletion request.
Possible values: [
deleted
]
Status Code
Credentials successfully deleted.
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.
No Sample Response
List Gateways
List the currently configured gateways.
List the currently configured gateways.
List the currently configured gateways.
List the currently configured gateways.
List the currently configured gateways.
GET /v1/environments/{environment_id}/gateways
ServiceCall<GatewayList> listGateways(ListGatewaysOptions listGatewaysOptions)
listGateways(params)
list_gateways(
self,
environment_id: str,
**kwargs,
) -> DetailedResponse
ListGateways(string environmentId)
Request
Use the ListGatewaysOptions.Builder
to create a ListGatewaysOptions
object that contains the parameter values for the listGateways
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The listGateways options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
curl -u "apikey":"{apikey}" -X GET "{url}/v1/environments/{environment_id}/gateways?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.ListGateways( environmentId: "{environmentId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; ListGatewaysOptions options = new ListGatewaysOptions.Builder() .environmentId(environmentId) .build(); GatewayList response = discovery.listGateways(options).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const listGatewaysParams = { environmentId: '{environment_id}', }; discovery.listGateways(listGatewaysParams) .then(gatewayList => { console.log(JSON.stringify(gatewayList, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Object containing gateways array.
Array of configured gateway connections.
Object containing gateways array.
Array of configured gateway connections.
- gateways
The gateway ID of the gateway.
The user defined name of the gateway.
The current status of the gateway.
connected
means the gateway is connected to the remotly installed gateway.idle
means this gateway is not currently in use.Possible values: [
connected
,idle
]The generated token for this gateway. The value of this field is used when configuring the remotly installed gateway.
The generated token_id for this gateway. The value of this field is used when configuring the remotly installed gateway.
Object containing gateways array.
Array of configured gateway connections.
- gateways
The gateway ID of the gateway.
The user defined name of the gateway.
The current status of the gateway.
connected
means the gateway is connected to the remotly installed gateway.idle
means this gateway is not currently in use.Possible values: [
connected
,idle
]The generated token for this gateway. The value of this field is used when configuring the remotly installed gateway.
The generated token_id for this gateway. The value of this field is used when configuring the remotly installed gateway.
Object containing gateways array.
Array of configured gateway connections.
- gateways
The gateway ID of the gateway.
The user defined name of the gateway.
The current status of the gateway.
connected
means the gateway is connected to the remotly installed gateway.idle
means this gateway is not currently in use.Possible values: [
connected
,idle
]The generated token for this gateway. The value of this field is used when configuring the remotly installed gateway.
The generated token_id for this gateway. The value of this field is used when configuring the remotly installed gateway.
Object containing gateways array.
Array of configured gateway connections.
- Gateways
The gateway ID of the gateway.
The user defined name of the gateway.
The current status of the gateway.
connected
means the gateway is connected to the remotly installed gateway.idle
means this gateway is not currently in use.Possible values: [
connected
,idle
]The generated token for this gateway. The value of this field is used when configuring the remotly installed gateway.
The generated token_id for this gateway. The value of this field is used when configuring the remotly installed gateway.
Status Code
Success
Invalid Environment ID
Unknown Environment ID
No Sample Response
Create Gateway
Create a gateway configuration to use with a remotely installed gateway.
Create a gateway configuration to use with a remotely installed gateway.
Create a gateway configuration to use with a remotely installed gateway.
Create a gateway configuration to use with a remotely installed gateway.
Create a gateway configuration to use with a remotely installed gateway.
POST /v1/environments/{environment_id}/gateways
ServiceCall<Gateway> createGateway(CreateGatewayOptions createGatewayOptions)
createGateway(params)
create_gateway(
self,
environment_id: str,
*,
name: str = None,
**kwargs,
) -> DetailedResponse
CreateGateway(string environmentId, string name = null)
Request
Use the CreateGatewayOptions.Builder
to create a CreateGatewayOptions
object that contains the parameter values for the createGateway
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The name of the gateway to created
User-defined name.
The createGateway options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
User-defined name.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
User-defined name.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
User-defined name.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
User-defined name.
curl -u "apikey":"{apikey}" -X POST -H "Content-Type: application/json" -d '{"name": "gateway_name"}' "{url}/v1/environments/{environment_id}/gateways?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.CreateGateway( environmentId: "{environmentId}", name: "gateway" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String gatewayName = "example_gateway"; CreateGatewayOptions options = new CreateGatewayOptions.Builder() .environmentId(environmentId) .name(gatewayName) .build(); Gateway response = discovery.createGateway(options).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const createGatewayParams = { environmentId: '{environment_id}', name: 'node-sdk-test', }; discovery.createGateway(createGatewayParams) .then(gateway => { console.log(JSON.stringify(gateway, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Object describing a specific gateway.
The gateway ID of the gateway.
The user defined name of the gateway.
The current status of the gateway.
connected
means the gateway is connected to the remotly installed gateway.idle
means this gateway is not currently in use.Possible values: [
connected
,idle
]The generated token for this gateway. The value of this field is used when configuring the remotly installed gateway.
The generated token_id for this gateway. The value of this field is used when configuring the remotly installed gateway.
Object describing a specific gateway.
The gateway ID of the gateway.
The user defined name of the gateway.
The current status of the gateway.
connected
means the gateway is connected to the remotly installed gateway.idle
means this gateway is not currently in use.Possible values: [
connected
,idle
]The generated token for this gateway. The value of this field is used when configuring the remotly installed gateway.
The generated token_id for this gateway. The value of this field is used when configuring the remotly installed gateway.
Object describing a specific gateway.
The gateway ID of the gateway.
The user defined name of the gateway.
The current status of the gateway.
connected
means the gateway is connected to the remotly installed gateway.idle
means this gateway is not currently in use.Possible values: [
connected
,idle
]The generated token for this gateway. The value of this field is used when configuring the remotly installed gateway.
The generated token_id for this gateway. The value of this field is used when configuring the remotly installed gateway.
Object describing a specific gateway.
The gateway ID of the gateway.
The user defined name of the gateway.
The current status of the gateway.
connected
means the gateway is connected to the remotly installed gateway.idle
means this gateway is not currently in use.Possible values: [
connected
,idle
]The generated token for this gateway. The value of this field is used when configuring the remotly installed gateway.
The generated token_id for this gateway. The value of this field is used when configuring the remotly installed gateway.
Object describing a specific gateway.
The gateway ID of the gateway.
The user defined name of the gateway.
The current status of the gateway.
connected
means the gateway is connected to the remotly installed gateway.idle
means this gateway is not currently in use.Possible values: [
connected
,idle
]The generated token for this gateway. The value of this field is used when configuring the remotly installed gateway.
The generated token_id for this gateway. The value of this field is used when configuring the remotly installed gateway.
Status Code
Success
Invalid Environment ID
Unknown Environment ID
No Sample Response
List Gateway Details
List information about the specified gateway.
List information about the specified gateway.
List information about the specified gateway.
List information about the specified gateway.
List information about the specified gateway.
GET /v1/environments/{environment_id}/gateways/{gateway_id}
ServiceCall<Gateway> getGateway(GetGatewayOptions getGatewayOptions)
getGateway(params)
get_gateway(
self,
environment_id: str,
gateway_id: str,
**kwargs,
) -> DetailedResponse
GetGateway(string environmentId, string gatewayId)
Request
Use the GetGatewayOptions.Builder
to create a GetGatewayOptions
object that contains the parameter values for the getGateway
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The requested gateway ID.
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The getGateway options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The requested gateway ID.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The requested gateway ID.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The requested gateway ID.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The requested gateway ID.
curl -u "apikey":"{apikey}" -X GET "{url}/v1/environments/{environment_id}/gateways/{gateway_id}?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.GetGateway( environmentId: "{environmentId}", gatewayId: "{gatewayId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String gatewayId = "{gateway_id}"; GetGatewayOptions options = new GetGatewayOptions.Builder() .environmentId(environmentId) .gatewayId(gatewayId) .build(); Gateway response = discovery.getGateway(options).execute().getResult();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const getGatewayParams = { environmentId: '{environment_id}', gatewayId: '{gateway_id}', }; discovery.getGateway(getGatewayParams) .then(gateway => { console.log(JSON.stringify(gateway, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Object describing a specific gateway.
The gateway ID of the gateway.
The user defined name of the gateway.
The current status of the gateway.
connected
means the gateway is connected to the remotly installed gateway.idle
means this gateway is not currently in use.Possible values: [
connected
,idle
]The generated token for this gateway. The value of this field is used when configuring the remotly installed gateway.
The generated token_id for this gateway. The value of this field is used when configuring the remotly installed gateway.
Object describing a specific gateway.
The gateway ID of the gateway.
The user defined name of the gateway.
The current status of the gateway.
connected
means the gateway is connected to the remotly installed gateway.idle
means this gateway is not currently in use.Possible values: [
connected
,idle
]The generated token for this gateway. The value of this field is used when configuring the remotly installed gateway.
The generated token_id for this gateway. The value of this field is used when configuring the remotly installed gateway.
Object describing a specific gateway.
The gateway ID of the gateway.
The user defined name of the gateway.
The current status of the gateway.
connected
means the gateway is connected to the remotly installed gateway.idle
means this gateway is not currently in use.Possible values: [
connected
,idle
]The generated token for this gateway. The value of this field is used when configuring the remotly installed gateway.
The generated token_id for this gateway. The value of this field is used when configuring the remotly installed gateway.
Object describing a specific gateway.
The gateway ID of the gateway.
The user defined name of the gateway.
The current status of the gateway.
connected
means the gateway is connected to the remotly installed gateway.idle
means this gateway is not currently in use.Possible values: [
connected
,idle
]The generated token for this gateway. The value of this field is used when configuring the remotly installed gateway.
The generated token_id for this gateway. The value of this field is used when configuring the remotly installed gateway.
Object describing a specific gateway.
The gateway ID of the gateway.
The user defined name of the gateway.
The current status of the gateway.
connected
means the gateway is connected to the remotly installed gateway.idle
means this gateway is not currently in use.Possible values: [
connected
,idle
]The generated token for this gateway. The value of this field is used when configuring the remotly installed gateway.
The generated token_id for this gateway. The value of this field is used when configuring the remotly installed gateway.
Status Code
Success
Invalid or Unknown Environment ID
No Sample Response
Delete Gateway
Delete the specified gateway configuration.
Delete the specified gateway configuration.
Delete the specified gateway configuration.
Delete the specified gateway configuration.
Delete the specified gateway configuration.
DELETE /v1/environments/{environment_id}/gateways/{gateway_id}
ServiceCall<GatewayDelete> deleteGateway(DeleteGatewayOptions deleteGatewayOptions)
deleteGateway(params)
delete_gateway(
self,
environment_id: str,
gateway_id: str,
**kwargs,
) -> DetailedResponse
DeleteGateway(string environmentId, string gatewayId)
Request
Use the DeleteGatewayOptions.Builder
to create a DeleteGatewayOptions
object that contains the parameter values for the deleteGateway
method.
Path Parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_-]*$
The requested gateway ID.
Query Parameters
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is
2019-04-30
.
The deleteGateway options.
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The requested gateway ID.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The requested gateway ID.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The requested gateway ID.
parameters
The ID of the environment.
Possible values: 1 ≤ length ≤ 255, Value must match regular expression
/^[a-zA-Z0-9_-]*$/
The requested gateway ID.
curl -u "apikey":"{apikey}" -X DELETE "{url}/v1/environments/{environment_id}/gateways/{gateway_id}?version=2019-04-30"
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator); discovery.SetServiceUrl("{url}"); var result = discovery.DeleteGateway( environmentId: "{environmentId}", gatewayId: "{gatewayId}" ); Console.WriteLine(result.Response);
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); Discovery discovery = new Discovery("2019-04-30", authenticator); discovery.setServiceUrl("{url}"); String environmentId = "{environment_id}"; String gatewayId = "{gateway_id}"; DeleteGatewayOptions options = new DeleteGatewayOptions.Builder() .environmentId(environmentId) .gatewayId(gatewayId) .build(); GatewayDelete response = discovery.deleteGateway(options).execute();
const DiscoveryV1 = require('ibm-watson/discovery/v1'); const { IamAuthenticator } = require('ibm-watson/auth'); const discovery = new DiscoveryV1({ version: '2019-04-30', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const deleteGatewayParams = { environmentId: '{environment_id}', gatewayId: '{gateway_id}', }; discovery.deleteGateway(deleteGatewayParams) .then(gatewayDelete => { console.log(JSON.stringify(gatewayDelete, null, 2)); }) .catch(err => { console.log('error:', err); });
Response
Gatway deletion confirmation
The gateway ID of the deleted gateway.
The status of the request.
Gatway deletion confirmation.
The gateway ID of the deleted gateway.
The status of the request.
Gatway deletion confirmation.
The gateway ID of the deleted gateway.
The status of the request.
Gatway deletion confirmation.
The gateway ID of the deleted gateway.
The status of the request.
Gatway deletion confirmation.
The gateway ID of the deleted gateway.
The status of the request.
Status Code
Success
Invalid or Unknown request parameters
Invalid or Unknown Environment ID