Les politiques en vigueur dans une zone
GET/api/public/v1/zones/{zone_id}/policies
The AIPs attached on the layer stack, each once: effective_mode is the strictest of its attachments on the path, attachment_mode this zone's own (null when it only inherits it) and attached_here whether this zone holds it; layer is this zone when it does, else the zone whose attachment sets the mode. mode filters on effective_mode; layer=authored keeps the AIPs attached here. dimensions[] is COMPUTED as the union of the policy's atoms' dimensions.
curl --fail-with-body -X GET 'https://app.openlatch.ai/api/public/v1/zones/<zone_id>/policies' \ -H "Authorization: Bearer $OPENLATCH_API_KEY"import jsonimport osimport urllib.request
request = urllib.request.Request( 'https://app.openlatch.ai/api/public/v1/zones/<zone_id>/policies', method='GET', headers={ 'Authorization': 'Bearer ' + os.environ['OPENLATCH_API_KEY'], },)with urllib.request.urlopen(request) as response: text = response.read().decode() print(json.dumps(json.loads(text), indent=2) if text else response.status)#!/usr/bin/env bashset -euo pipefail
curl -sS --fail-with-body -X GET 'https://app.openlatch.ai/api/public/v1/zones/<zone_id>/policies' \ -H "Authorization: Bearer $OPENLATCH_API_KEY" | jq .$headers = @{ Authorization = "Bearer $env:OPENLATCH_API_KEY"}Invoke-RestMethod -Method GET -Uri 'https://app.openlatch.ai/api/public/v1/zones/<zone_id>/policies' -Headers $headers | ConvertTo-Json -Depth 20Autorisation
Section intitulée « Autorisation »| Rôle dans l’organisation | Ce point de terminaison |
|---|---|
owner | Autorisé |
admin | Autorisé |
editor | Autorisé |
viewer | Autorisé |
Une clé porte le rôle que son propriétaire détient dans l’organisation. Voir Authentification.
Portée de clé d’API : policies:read
Paramètres de chemin
Section intitulée « Paramètres de chemin »| Paramètre | Type | Description |
|---|---|---|
zone_id | string (uuid) | Obligatoire. |
Paramètres de requête
Section intitulée « Paramètres de requête »| Paramètre | Type | Description |
|---|---|---|
dimension | string or null | |
mode | string or null | |
layer | string or null | |
q | string or null | |
page | integer | |
page_size | integer |
- 200 OK — l’appel a réussi.
- 401 Unauthorized —
UNAUTHORIZED - 402 Payment Required —
license_expired - 403 Forbidden —
FEATURE_DISABLED,FORBIDDEN,INSUFFICIENT_SCOPE - 404 Not Found —
NOT_FOUND - 422 Unprocessable Content —
INVALID_ID,VALIDATION_ERROR - 429 Too Many Requests —
TOO_MANY_REQUESTS - 500 Internal Server Error —
INTERNAL_SERVER_ERROR,tenant_isolation_violation - 503 Service Unavailable —
ENGINE_UNAVAILABLE,FEATURE_STATE_UNAVAILABLE,SERVICE_UNAVAILABLE
Champs de la réponse
Section intitulée « Champs de la réponse »| Champ | Type | Description |
|---|---|---|
data | array of object | Obligatoire. |
data[].anomalies_7d | integer | |
data[].attached_here | boolean | Whether the viewed zone holds its own attachment. |
data[].attachment_mode | string — one of disabled, monitor, enforce or null | The viewed zone's own attachment mode; null when it only inherits the AIP. |
data[].coverage | object | Obligatoire. D-66 — installs counted from stamped negotiation, never from mode + recent poll. |
data[].coverage.compatibility_unavailable_installs | integer | Obligatoire. |
data[].coverage.enforced_installs | integer | Obligatoire. |
data[].dimensions | array of string | Obligatoire. |
data[].display_title | string | The AIP's name: its title, else its generated_title, else its statement. |
data[].effective_layer | object or null | The zone whose attachment sets effective_mode when it is not layer; null otherwise. |
data[].effective_mode | string — one of disabled, monitor, enforce or null | The mode the AIP runs in at the viewed zone: the strictest attachment on its path. |
data[].id | string | Obligatoire. |
data[].intents | object | Obligatoire. How many of the policy's atoms are actually enforceable. |
data[].intents.enforceable | integer | Obligatoire. |
data[].intents.monitor_only | integer | Obligatoire. |
data[].intents.total | integer | Obligatoire. |
data[].layer | object | Obligatoire. The layer a policy row is labelled with: the zone being viewed when it holds the AIP, else the zone whose
attachment sets its mode there. `inherited` is true when the viewed zone holds no attachment of it. |
data[].layer.inherited | boolean | Obligatoire. |
data[].layer.label | string | Obligatoire. |
data[].layer.unit_id | string | Obligatoire. |
data[].layer.zone_id | string | Obligatoire. |
data[].mode | string | Obligatoire. Deprecated: attachment_mode when the viewed zone holds it, else effective_mode. |
data[].preset | object or null | |
data[].public_id | string | Obligatoire. |
data[].statement | string | Obligatoire. |
data[].status | string | Obligatoire. |
data[].version | integer | Obligatoire. |
page | integer | Obligatoire. |
page_size | integer | Obligatoire. |
total | integer | Obligatoire. |
Exemple de réponse
Section intitulée « Exemple de réponse »{ "data": [ { "anomalies_7d": 0, "attached_here": false, "attachment_mode": "disabled", "coverage": { "compatibility_unavailable_installs": 3, "enforced_installs": 3 }, "dimensions": [ "string" ], "display_title": "", "effective_layer": { "inherited": false, "label": "string", "unit_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10", "zone_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10" }, "effective_mode": "disabled", "id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10", "intents": { "enforceable": 3, "monitor_only": 3, "total": 3 }, "layer": { "inherited": false, "label": "string", "unit_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10", "zone_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10" }, "mode": "string", "preset": { "application_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10", "preset_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10", "preset_name": "release-bot", "preset_policy_key": "string", "preset_version": 3 }, "public_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10", "statement": "string", "status": "string", "version": 3 } ], "page": 1, "page_size": 3, "total": 3}