List the registered rails, their declared properties and their state
curl --request GET \
--url https://api.example.com/v1/channels \
--header 'Authorization: Bearer <token>'package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/channels"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/v1/channels', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.example.com/v1/channels"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"items": [
{
"descriptor": {
"channelId": "spb",
"consumerTopology": "SINGLE_WRITER",
"deliveryModes": [
"SINGLE_ENGINE"
],
"durabilityRule": "PERSIST_BEFORE_DECIDE",
"financialFamilies": [
"<string>"
],
"hasBypass": true,
"ingressModel": "DRAIN_PULL",
"ownershipKinds": [
"<string>"
],
"retentionReasons": [
"<string>"
],
"moneyBearingFamilies": [
"<string>"
]
},
"state": {
"channelId": "spb",
"bypass": {
"active": true,
"channelId": "spb",
"declaredAt": "2023-11-07T05:31:56Z",
"declaredBy": "<string>",
"engineId": "<string>",
"reason": "<string>",
"suspendedGuarantees": [
"<string>"
]
},
"lastReconciliationAt": "2023-11-07T05:31:56Z",
"lease": {
"epoch": 1,
"heartbeatAt": "2023-11-07T05:31:56Z",
"held": true,
"state": "consuming",
"haltReason": "<string>",
"holderId": "<string>",
"lastProgressAt": "2023-11-07T05:31:56Z",
"progressAgeSeconds": 1
},
"reconciliationRunning": true
}
}
]
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}List the registered rails, their declared properties and their state
The rail contract, made visible. Reading this before attempting a bypass is how a client discovers that a rail declares hasBypass: false rather than discovering it from a 422. Listing requires an identified operator holding channels:read, because the listing returns declaredBy, an operator identity.
GET
/
v1
/
channels
List the registered rails, their declared properties and their state
curl --request GET \
--url https://api.example.com/v1/channels \
--header 'Authorization: Bearer <token>'package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/channels"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/v1/channels', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.example.com/v1/channels"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"items": [
{
"descriptor": {
"channelId": "spb",
"consumerTopology": "SINGLE_WRITER",
"deliveryModes": [
"SINGLE_ENGINE"
],
"durabilityRule": "PERSIST_BEFORE_DECIDE",
"financialFamilies": [
"<string>"
],
"hasBypass": true,
"ingressModel": "DRAIN_PULL",
"ownershipKinds": [
"<string>"
],
"retentionReasons": [
"<string>"
],
"moneyBearingFamilies": [
"<string>"
]
},
"state": {
"channelId": "spb",
"bypass": {
"active": true,
"channelId": "spb",
"declaredAt": "2023-11-07T05:31:56Z",
"declaredBy": "<string>",
"engineId": "<string>",
"reason": "<string>",
"suspendedGuarantees": [
"<string>"
]
},
"lastReconciliationAt": "2023-11-07T05:31:56Z",
"lease": {
"epoch": 1,
"heartbeatAt": "2023-11-07T05:31:56Z",
"held": true,
"state": "consuming",
"haltReason": "<string>",
"holderId": "<string>",
"lastProgressAt": "2023-11-07T05:31:56Z",
"progressAgeSeconds": 1
},
"reconciliationRunning": true
}
}
]
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}Esta página foi útil?

