REST - /v1/.well-known
For client examples, see this section.
OpenID Configuration
If OpenID Connect (OIDC) authentication is enabled, the endpoint returns configuration details.
If a token is configured, the endpoint redirects to it.
Usage
The discovery endpoint accepts a GET
request:
GET /v1/.well-known/openid-configuration
If there is an OIDC provider, the endpoint returns the following fields:
href
: The reference to the client.cliendID
: The ID of the client.
If there is no OIDC provider, the endpoint returns a 404
HTTP status code.
Example
- Python (v4)
- Python (v3)
- JavaScript/TypeScript
- Go
- Java
- Curl
import weaviate
client = weaviate.connect_to_local()
open_id_configuration = client.get_open_id_configuration()
print(open_id_configuration)
finally:
client.close()
import weaviate
client = weaviate.Client("http://localhost:8080")
open_id_configuration = client.get_open_id_configuration()
print(open_id_configuration)
import weaviate from 'weaviate-ts-client';
const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
});
const response = await client.misc
.openidConfigurationGetter()
.do();
console.log(JSON.stringify(response, null, 2));
package main
import (
"context"
"fmt"
"github.com/weaviate/weaviate-go-client/v4/weaviate"
)
func main() {
cfg := weaviate.Config{
Host: "localhost:8080",
Scheme: "http",
}
client, err := weaviate.NewClient(cfg)
if err != nil {
panic(err)
}
openIDConfig, err := client.Misc().OpenIDConfigurationGetter().Do(context.Background())
if err != nil {
panic(err)
}
fmt.Printf("%v", openIDConfig)
}
package io.weaviate;
import io.weaviate.client.Config;
import io.weaviate.client.WeaviateClient;
import io.weaviate.client.base.Result;
import io.weaviate.client.v1.misc.model.OpenIDConfiguration;
public class App {
public static void main(String[] args) {
Config config = new Config("http", "localhost:8080");
WeaviateClient client = new WeaviateClient(config);
Result<OpenIDConfiguration> result = client.misc().openIDConfigGetter().run();
if (result.hasErrors()) {
System.out.println(result.getError());
return;
}
System.out.println(result.getResult());
}
}
curl http://localhost:8080/v1/.well-known/openid-configuration
If OIDC is configured, the endpoint returns a document like this:
{
"href": "http://my-token-issuer/auth/realms/my-weaviate-usecase",
"cliendID": "my-weaviate-client"
}
Liveness
The live
endpoint checks if the application is alive. You can use it for a Kubernetes liveness probe.
Usage
The endpoint accepts a GET
request:
GET /v1/.well-known/live
The endpoint returns HTTP status code 200
if the application is able to respond to HTTP requests.
Example
- Python (v4)
- Python (v3)
- JavaScript/TypeScript
- Go
- Java
- Curl
import weaviate
client = weaviate.connect_to_local()
print(client.is_live())
finally:
client.close()
import weaviate
client = weaviate.Client("http://localhost:8080")
is_live = client.is_live()
print(is_live)
import weaviate from 'weaviate-ts-client';
const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
});
const response = await client.misc
.liveChecker()
.do();
console.log(response);
package main
import (
"context"
"fmt"
"github.com/weaviate/weaviate-go-client/v4/weaviate"
)
func main() {
cfg := weaviate.Config{
Host: "localhost:8080",
Scheme: "http",
}
client, err := weaviate.NewClient(cfg)
if err != nil {
panic(err)
}
isLive, err := client.Misc().LiveChecker().Do(context.Background())
if err != nil {
panic(err)
}
fmt.Printf("%v", isLive)
}
package io.weaviate;
import io.weaviate.client.Config;
import io.weaviate.client.WeaviateClient;
import io.weaviate.client.base.Result;
public class App {
public static void main(String[] args) {
Config config = new Config("http", "localhost:8080");
WeaviateClient client = new WeaviateClient(config);
Result<Boolean> result = client.misc().liveChecker().run();
if (result.hasErrors()) {
System.out.println(result.getError());
return;
}
System.out.println(result.getResult());
}
}
curl http://localhost:8080/v1/.well-known/live
The endpoint returns HTTP status code 200
if the application is able to respond to HTTP requests.
Readiness
The ready
endpoint checks if the application is ready to receive traffic. You can use it for Kubernetes readiness probe.
Usage
The discovery endpoint accepts a GET
request:
GET /v1/.well-known/ready
The endpoint returns HTTP status code 200
if the application is able to respond to HTTP requests. If the application is currently unable to serve traffic, the endpoint returns HTTP status code 503
.
If the application is unavailable and you have horizontal replicas of Weaviate that can receive traffic, redirect traffic to one of the replicas.
Example
- Python (v4)
- Python (v3)
- JavaScript/TypeScript
- Go
- Java
- Curl
import weaviate
client = weaviate.connect_to_local()
print(client.is_ready())
finally:
client.close()
import weaviate
client = weaviate.Client("http://localhost:8080")
is_ready = client.is_ready()
print(is_ready) # returns True if Weaviate is ready
import weaviate from 'weaviate-ts-client';
const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
});
const response = await client.misc
.readyChecker()
.do();
console.log(response);
package main
import (
"context"
"fmt"
"github.com/weaviate/weaviate-go-client/v4/weaviate"
)
func main() {
cfg := weaviate.Config{
Host: "localhost:8080",
Scheme: "http",
}
client, err := weaviate.NewClient(cfg)
if err != nil {
panic(err)
}
isReady, err := client.Misc().ReadyChecker().Do(context.Background())
if err != nil {
panic(err)
}
fmt.Printf("%v", isReady)
}
package io.weaviate;
import io.weaviate.client.Config;
import io.weaviate.client.WeaviateClient;
import io.weaviate.client.base.Result;
public class App {
public static void main(String[] args) {
Config config = new Config("http", "localhost:8080");
WeaviateClient client = new WeaviateClient(config);
Result<Boolean> result = client.misc().readyChecker().run();
if (result.hasErrors()) {
System.out.println(result.getError());
return;
}
System.out.println(result.getResult());
}
}
curl http://localhost:8080/v1/.well-known/ready
The endpoint returns HTTP status code 200
if the application is able to respond to HTTP requests.
Questions and feedback
If you have any questions or feedback, let us know in our user forum.