Reorder a policy's bindings in a ledger
curl --request PUT \
--url https://tracer.sandbox.lerian.net/v1/bindings/order \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bindingIds": [
"<string>"
],
"ledgerId": "<string>",
"policyId": "<string>"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://tracer.sandbox.lerian.net/v1/bindings/order"
payload := strings.NewReader("{\n \"bindingIds\": [\n \"<string>\"\n ],\n \"ledgerId\": \"<string>\",\n \"policyId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({bindingIds: ['<string>'], ledgerId: '<string>', policyId: '<string>'})
};
fetch('https://tracer.sandbox.lerian.net/v1/bindings/order', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://tracer.sandbox.lerian.net/v1/bindings/order"
payload = {
"bindingIds": ["<string>"],
"ledgerId": "<string>",
"policyId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"items": [
{
"bindingId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"ledgerId": "<string>",
"limitsAction": "ENFORCE",
"policyId": "<string>",
"position": 123,
"rulesAction": "ENFORCE",
"selector": {
"scheme": "<string>"
},
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}{
"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"
}
}Reorder a policy's bindings in a ledger
Use this endpoint to set the order of a policy’s bindings in a ledger: list each of them once, and they take positions 1..n in that order, atomically.
PUT
/
v1
/
bindings
/
order
Reorder a policy's bindings in a ledger
curl --request PUT \
--url https://tracer.sandbox.lerian.net/v1/bindings/order \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bindingIds": [
"<string>"
],
"ledgerId": "<string>",
"policyId": "<string>"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://tracer.sandbox.lerian.net/v1/bindings/order"
payload := strings.NewReader("{\n \"bindingIds\": [\n \"<string>\"\n ],\n \"ledgerId\": \"<string>\",\n \"policyId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({bindingIds: ['<string>'], ledgerId: '<string>', policyId: '<string>'})
};
fetch('https://tracer.sandbox.lerian.net/v1/bindings/order', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://tracer.sandbox.lerian.net/v1/bindings/order"
payload = {
"bindingIds": ["<string>"],
"ledgerId": "<string>",
"policyId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"items": [
{
"bindingId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"ledgerId": "<string>",
"limitsAction": "ENFORCE",
"policyId": "<string>",
"position": 123,
"rulesAction": "ENFORCE",
"selector": {
"scheme": "<string>"
},
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}{
"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"
}
}Autorizações
BearerAuthApiKeyAuth
Corpo
application/json
Esta página foi útil?

