curl --request GET \
--url https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}/users/{user_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}/users/{user_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}/users/{user_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}/users/{user_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}/users/{user_id}"
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))
}HttpResponse<String> response = Unirest.get("https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}/users/{user_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}/users/{user_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"cycle_acu_limit_override": 123,
"effective_cycle_acu_limit": 123,
"email": "<string>",
"fallback_cycle_acu_limit": 123,
"fallback_tier_id": "<string>",
"fallback_tier_name": "<string>",
"limit_source": "override",
"membership": "explicit",
"name": "<string>",
"pending_request_cycle_acu_limit": 123,
"pending_request_id": "<string>",
"primary_cycle_acu_limit": 123,
"temporary_cycle_acu_limit": 123,
"tier_cycle_acu_limit": 123,
"tier_id": "<string>",
"tier_name": "<string>",
"user_id": "<string>"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}Ottieni la policy di utilizzo di un utente
Recupera il tier e il limite di ACU per ciclo attualmente applicato in modo vincolante a un utente.
Determina il tier dell’utente (in base all’assegnazione esplicita, altrimenti alla mappatura dei gruppi IdP, altrimenti al livello predefinito dell’account), le relative eccezioni, il limite effettivo ed eventuali richieste di aumento del limite in sospeso. Accetta ID di utenti umani e ID di utenti di servizio; in entrambi i casi l’utente deve essere un membro dell’account. Richiede ViewAccountConsumption e ViewAccountMembership.
curl --request GET \
--url https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}/users/{user_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}/users/{user_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}/users/{user_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}/users/{user_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}/users/{user_id}"
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))
}HttpResponse<String> response = Unirest.get("https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}/users/{user_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/enterprise/usage-policies/budgets/{budget_id}/users/{user_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"cycle_acu_limit_override": 123,
"effective_cycle_acu_limit": 123,
"email": "<string>",
"fallback_cycle_acu_limit": 123,
"fallback_tier_id": "<string>",
"fallback_tier_name": "<string>",
"limit_source": "override",
"membership": "explicit",
"name": "<string>",
"pending_request_cycle_acu_limit": 123,
"pending_request_id": "<string>",
"primary_cycle_acu_limit": 123,
"temporary_cycle_acu_limit": 123,
"tier_cycle_acu_limit": 123,
"tier_id": "<string>",
"tier_name": "<string>",
"user_id": "<string>"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}Autorizzazioni
Richiede un utente di servizio o un token di accesso personale con l’autorizzazioneManageAcuLimits a livello aziendale, oppure l’accesso delegato al budget.Autorizzazioni
Parametri del percorso
Risposta
Risposta riuscita
Il tier determinato per l'utente, il limite di ACU per ciclo e la richiesta in sospeso.
Il motivo dell'appartenenza dell'utente al tier: 'explicit' (assegnazione diretta), 'idp_group' o 'university_certification' (tramite la mappatura al tier del gruppo IDP o della certificazione che ha la precedenza), oppure 'default' (ricorso al livello predefinito dell'account).
explicit, idp_group, university_certification, default Il livello da cui viene determinato il limite dell'utente: quello assegnato esplicitamente, altrimenti quello associato tramite mappatura al gruppo IdP che ha la precedenza oppure, in mancanza di entrambi, il livello predefinito dell'account. Il valore è null quando l'account non ha livelli; in tal caso l'utente non ha un limite massimo.

