Gruppi
Recupero di tutti i gruppi
Richiesta
Definizione
GET /api/v1/groups
Header
-
Authorization
richiestoToken di autenticazione con privilegi di lettura per la risorsa.
Bearer {token}
Risposta
Codici di stato
Codici di stato | Messaggio |
---|---|
200 | "List of groups" |
403 | "Forbidden" |
Corpo della risposta
- Attributi
- Esempio
-
data.groups.id
stringCodice identificativo del gruppo.
-
data.groups.name
stringNome del gruppo.
-
data.groups.is_admin
booleanSe il gruppo fornisce privilegi di amministratore.
-
data.groups.created_at
stringData di creazione del gruppo.
-
data.groups.updated_at
stringData dell'ultima modifica del gruppo.
-
data.groups.description
booleanDescrizione del gruppo.
{
"data": {
"groups": [
{
"created_at": "2024-01-17T13:11:22Z",
"description": "Group of administration with all permissions.",
"id": "fd4cxxxx-c814-xxxx-a8c6-xxx7exxxf36b",
"is_admin": true,
"name": "admins",
"updated_at": "2024-01-17T13:11:22Z"
},
{
"created_at": "2024-01-17T13:11:45Z",
"description": "Group with maximum privileges",
"id": "467d01a9-dbba-486a-aadf-eed2751009d2",
"is_admin": false,
"name": "Administrators",
"updated_at": "2024-01-17T13:11:45Z"
}
]
},
"message": "List of groups",
"status": "ok"
}
Recupero di uno specifico gruppo
Richiesta
Definizione
GET /api/v1/groups/{id}
Header
-
Authorization
richiestoToken di autenticazione con privilegi di lettura per la risorsa.
Bearer {token}
Risposta
Codice di stato
Codice di stato | Messaggio |
---|---|
200 | "Group retrieved" |
400 | "Error retrieving group" |
403 | "Forbidden" |
Corpo della risposta
{
"data": {
"groups": [
{
"created_at": "2024-01-17T13:11:22Z",
"description": "Group of administration with all permissions.",
"id": "fd4ccc2e-c814-4c34-a8c6-a7a7e6abf36b",
"is_admin": true,
"name": "admins",
"updated_at": "2024-01-17T13:11:22Z"
},
{
"created_at": "2024-01-17T13:11:45Z",
"description": "Group with maximum privileges",
"id": "467d01a9-dbba-486a-aadf-eed2751009d2",
"is_admin": false,
"name": "Administrators",
"updated_at": "2024-01-17T13:11:45Z"
}
]
},
"message": "List of groups",
"status": "ok"
}
Creazione di un gruppo
Richiesta
Definizione
POST /api/v1/groups
Header
-
Authorization
richiestoToken di autenticazione con privilegi di lettura per la risorsa.
Bearer {token}
-
Content-Type
richiestoapplication/json
Corpo della richiesta
{
"group": {
"description": "Group with maximum privileges",
"name": "Administrators",
"permissions": [
{
"permission_id": 0,
"service_id": "3IxxxCD2xxxTQLPxxxZA9A=="
},
{
"permission_id": 1,
"service_id": "3xxxGCD2NoxxxLPxxxZxxx=="
},
{
"permission_id": 2,
"service_id": "T5DrjPSxxxx£rhc="
}
],
"user_ids": [
"ecd765fd-5b54-462a-a133-1eb8e37bc333"
]
}
}
Risposta
Codice di stato
Codice di stato | Messaggio |
---|---|
200 | "Group created succesfully" |
400 | "Error creating new group" |
403 | "Forbidden" |
Corpo della risposta
{
"data": {
"group": {
"created_at": "2024-01-17T13:11:49Z",
"description": "Group with maximum privileges",
"id": "c94xxfb9-xxxx-420c-xxxx-9e0daxxx3543",
"is_admin": false,
"name": "Administrators",
"permissions": [
{
"expired_at": null,
"inserted_at": "2024-01-17T13:11:49Z",
"permission_description": "User can visualize and ignore alerts. He can also explore related HTTP transactions.",
"permission_id": 0,
"permission_name": "Explore alerts",
"service_id": "3IxxxCD2xxxTQLPxxxZA9A==",
"service_name": "www.test.it"
},
{
"expired_at": null,
"inserted_at": "2024-01-17T13:11:49Z",
"permission_description": "User can visualize, create, modify and delete rules, either as Application and Source.",
"permission_id": 1,
"permission_name": "Handle rules",
"service_id": "3xxxGCD2NoxxxLPxxxZxxx==",
"service_name": "www.test.it"
},
{
"expired_at": null,
"inserted_at": "2024-01-17T13:11:49Z",
"permission_description": "User can load Applications Rules to a Web Application Firewall",
"permission_id": 2,
"permission_name": "Load application rules",
"service_id": "T5DrjPSxxxx£rhc=",
"service_name": "default"
}
],
"updated_at": "2024-01-17T13:11:49Z",
"users": [
{
"id": "ecdxx5fd-xxxx-462a-xxxx-1eb8exxxc333",
"username": "test"
}
]
}
},
"message": "Group created succesfully",
"status": "ok"
}
Modifica di un gruppo
Richiesta
Definizione
PUT /api/v1/groups/{id}
Header
-
Authorization
richiestoToken di autenticazione con privilegi di lettura per la risorsa.
Bearer {token}
-
Content-Type
richiestoapplication/json
Corpo della richiesta
{
"attrs": {
"name": "new_name",
"permissions": [
{
"permission_id": 0,
"service_id": "3IxxGCD2xxxTQLPxxxZA9x=="
},
{
"permission_id": 1,
"service_id": "3IxxGCxxxxMTQLxxxSZxxA=="
},
{
"permission_id": 2,
"service_id": "xxxx"
},
{
"permission_id": 3,
"service_id": "xxxxx"
}
],
"user_ids": [
"5dxx29e0-xxx-4308-xxxx-6a71axxx0ac9",
"d4bx18xx-xxxx-4b8e-xxxx-51615xxx4e5"
]
}
}
Risposta
Codici di stato
Codici di stato | Messaggio |
---|---|
200 | "Group updated succesfully" |
400 | "Error updating the group." |
403 | "Forbidden" |
Corpo della risposta
{
"data": {
"group": {
"created_at": "2024-01-17T13:11:49Z",
"description": "Group with maximum privileges",
"id": "c6xxx00a-xxda-xxxx-904c-ca5xx10axxx4",
"is_admin": false,
"name": "new_name",
"permissions": [
{
"expired_at": null,
"inserted_at": "2024-01-17T13:11:49Z",
"permission_description": "User can visualize and ignore alerts. He can also explore related HTTP transactions.",
"permission_id": 0,
"permission_name": "Explore alerts",
"service_id": "3IxxGCD2xxxTQLPxxxZA9x==",
"service_name": "www.test.it"
},
{
"expired_at": null,
"inserted_at": "2024-01-17T13:11:49Z",
"permission_description": "User can visualize, create, modify and delete rules, either as Application and Source.",
"permission_id": 1,
"permission_name": "Handle rules",
"service_id": "3IxxGCxxxxMTQLxxxSZxxA==",
"service_name": "www.test.it"
},
{
"expired_at": null,
"inserted_at": "2024-01-17T13:11:49Z",
"permission_description": "User can load Applications Rules to a Web Application Firewall",
"permission_id": 2,
"permission_name": "Load application rules",
"service_id": "xxxx",
"service_name": "default"
},
{
"expired_at": null,
"inserted_at": "2024-01-17T13:11:49Z",
"permission_description": "User can load Source Rules to a Firewall",
"permission_id": 3,
"permission_name": "Load source rules",
"service_id": "xxxxx",
"service_name": "default"
}
],
"updated_at": "2024-01-17T13:11:49Z",
"users": [
{
"id": "5d6xxxe0-875d-xxxx-95c1-6a7xx6f1xxx9",
"username": "test"
},
{
"id": "d4bxxx88-xxxx-4xxe-xx11-516xxxxf94e5",
"username": "test2"
}
]
}
},
"message": "Group updated succesfully",
"status": "ok"
}
Eliminazione di un gruppo
Richiesta
Definizione
DELETE /api/v1/groups/{id}
Header
-
Authorization
richiestoToken di autenticazione con privilegi di lettura per la risorsa.
Bearer {token}
-
Content-Type
richiestoapplication/json
Risposta
Codici di stato
Codici di stato | Messaggio |
---|---|
200 | "Group deleted succesfully" |
400 | "Error deleting the group." |
403 | "Forbidden" |
Corpo della risposta
{
"data": {
"group": {
"created_at": "2024-01-17T13:11:46Z",
"description": "Group with maximum privileges",
"id": "exb2xxx0-xxxx-4b69-xxxx-8442xxx517ef",
"is_admin": false,
"name": "Administrators",
"updated_at": "2024-01-17T13:11:46Z"
}
},
"message": "Group deleted succesfully",
"status": "ok"
}