Register Instance
PUT//localhost:11337/registry-svc/instance
Registers an instance. Idempotent.
Request
- application/json
Bodyrequired
Register Instance Request
deploymentIdstring
The ID of the deployment that this instance is an instance of.
Example:
depl_deBUCtJirc
hoststring
Host of the instance address. Required if URL is not provided
Example:
myserver.com
idstring
Example:
inst_di9riJEvH2
ipstring
IP of the instance address. Optional: to register by IP instead of host
Example:
8.8.8.8
pathstring
Path of the instance address. Optional (e.g., "/api")
Example:
/your-svc
portinteger
Port of the instance address. Required if URL is not provided
Example:
8080
schemestring
Scheme of the instance address. Required if URL is not provided.
Example:
https
urlstringrequired
Full address URL of the instance.
Example:
https://myserver.com:5981
Responses
- 201
- 400
- 401
- 500
Created
- application/json
- Schema
- Example (auto)
Schema
objectobject
{}
Invalid JSON
- application/json
- Schema
- Example (auto)
Schema
errorstring
{
"error": "string"
}
Unauthorized
- application/json
- Schema
- Example (auto)
Schema
errorstring
{
"error": "string"
}
Internal Server Error
- application/json
- Schema
- Example (auto)
Schema
errorstring
{
"error": "string"
}
Authorization: Authorization
name: Authorizationtype: apiKeydescription: Type "Bearer" followed by a space and token acquired from the User Svc Login endpoint.in: header
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "//localhost:11337/registry-svc/instance");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "<Authorization>");
var content = new StringContent("{\n \"deploymentId\": \"depl_deBUCtJirc\",\n \"host\": \"myserver.com\",\n \"id\": \"inst_di9riJEvH2\",\n \"ip\": \"8.8.8.8\",\n \"path\": \"/your-svc\",\n \"port\": 8080,\n \"scheme\": \"https\",\n \"url\": \"https://myserver.com:5981\"\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear