Library Countermeasure Implementation

Get All Library Countermeasure Implementations

This endpoint retrieves a list of Library Countermeasure Implementation resources.

GET /api/v2/library/tasks/{task_id}/implementations/

Query Parameters

Parameter Description
active The active status of the Library Countermeasure Implementation. Can be either true or false.
show_original Whether to return the original content for a Built-In Modified Library Countermeasure Implementation (default is False).

URL Parameters

Parameter Description
task_id The id of the library countermeasure the new Library Countermeasure Implementation belongs to.
GET /api/v2/library/tasks/T1/implementations/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json
{
    "results": [{
        "id": -1,
        "item_id": "CI1",
        "title": "A Countermeasure Implementation",
        "text": "Countermeasure implementation Description",
        "type": "Custom",
        "last_modified_date_time": "2024-07-09T12:33:24.741899-04:00",
        "last_modified_by": {
            "id": 1,
            "email": "admin@example.com",
            "first_name": "Admin",
            "last_name": "Testerton"
        },
        "created_date_time": "2024-07-09T12:33:24.741883-04:00",
        "created_by": {
            "id": 1,
            "email": "admin@example.com",
            "first_name": "Admin",
            "last_name": "Testerton"
        },
        "active": true,
        "match_conditions": [
            {
                "db_id": -1,
                "id": "CMC1",
                "required": [
                    "A6"
                ],
                "excluded": []
            }
        ]
    }]
}

Get a Library Countermeasure Implementation

This endpoint retrieves a single Library Countermeasure Implementation resource.

GET /api/v2/library/tasks/{task_id}/implementations/{implementation_id}/

URL Parameters

Parameter Description
task_id The id of the library countermeasure the new Library Countermeasure Implementation belongs to.
implementation_id The id of the Library Countermeasure Implementation to retrieve.

All of the query parameters for the 'Get all Library Countermeasure Implementations' endpoint apply here as well.

GET /api/v2/library/tasks/T1/implementations/CI1/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json
{
    "id": -1,
    "item_id": "CI1",
    "title": "A Countermeasure Implementation",
    "text": "Countermeasure Implementation Description",
    "type": "Custom",
    "last_modified_date_time": "2024-07-09T12:33:24.741899-04:00",
    "last_modified_by": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton"
    },
    "created_date_time": "2024-07-09T12:33:24.741883-04:00",
    "created_by": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton"
    },
    "active": true,
    "match_conditions": [
        {
            "db_id": -1,
            "id": "CMC1",
            "required": [
                "A6"
            ],
            "excluded": []
        }
    ]
}

Create a Library Countermeasure Implementation

This endpoint creates a new Library Countermeasure Implementation resource.

POST /api/v2/library/tasks/{task_id}/implementations/

URL Parameters

Parameter Description
task_id The id of the Library Countermeasure the new Library Countermeasure Implementation belongs to.

Payload

Fields Required Description
title Yes The title of the library countermeasure implementation.
text Yes The description text of the Library Countermeasure Implementation.
match_conditions No A list of dictionaries representing the set of match conditions belonging to this library countermeasure implementation. Each dictionary has required and excluded fields which are arrays of answer IDs. When an answer is in the required array, this countermeasure implementation will be included in project countermeasures that include the answer. When an answer is in the excluded array, this countermeasure implementation will not be included in project countermeasures that include this answer.
active No Library countermeasure implementation can be activated or deactivated.
POST /api/v2/library/tasks/T1/implementations/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
{
    "title": "A New Countermeasure Implementation",
    "text": "Countermeasure Implementation Description",
    "match_conditions": [
        {
            "required": ["A6"],
            "excluded": []
        }
    ],
    "active": true
}
HTTP/1.1 200 OK
Content-Type: application/json
{
    "id": -1,
    "item_id": "CI1",
    "title": "A New Countermeasure Implementation",
    "text": "Countermeasure Implementation Description",
    "type": "Custom",
    "last_modified_date_time": "2024-07-09T12:33:24.741899-04:00",
    "last_modified_by": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton"
    },
    "created_date_time": "2024-07-09T12:33:24.741883-04:00",
    "created_by": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton"
    },
    "active": true,
    "match_conditions": [
        {
            "db_id": -1,
            "id": "CMC1",
            "required": [
                "A6"
            ],
            "excluded": []
        }
    ]
}

Update a Library Countermeasure Implementation

This endpoint updates a specific Library Countermeasure Implementation resource, as specified by the id parameter.

PATCH /api/v2/library/tasks/{task_id}/implementations/{implementation_id}/

URL Parameters

Parameter Description
task_id The id of the library countermeasure the Library Countermeasure Implementation belongs to.
implementation_id The id of the Library Countermeasure Implementation to update.

Payload

Fields Required Description
title No The title of the library Countermeasure Implementation.
text No The description text of the library Countermeasure Implementation.
match_conditions No A list of dictionaries representing the set of match conditions belonging to this library Countermeasure Implementation. Each dictionary has required and excluded fields which are arrays of answer IDs. When an answer is in the required array, this Countermeasure Implementation will be included in project countermeasures that include the answer. When an answer is in the excluded array, this Countermeasure Implementation will not be included in project countermeasures that include this answer.
active No Library Countermeasure Implementations can be activated or deactivated.
PATCH /api/v2/library/tasks/T1/implementations/CI1/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
{
    "title": "Updated Countermeasure Implementation",
    "text": "Updated Countermeasure Implementation Description",
    "match_conditions": [
        {
            "required": ["A2"],
            "excluded": []
        }
    ],
    "active": false
}
HTTP/1.1 200 OK
Content-Type: application/json
{
    "id": -1,
    "item_id": "CI1",
    "title": "Updated Countermeasure Implementation",
    "text": "Updated Countermeasure Implementation Description",
    "type": "Custom",
    "ordinal": 1,
    "last_modified_date_time": "2024-07-09T14:43:00.593591-04:00",
    "last_modified_by": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton"
    },
    "created_date_time": "2024-07-09T12:33:24.741883-04:00",
    "created_by": {
        "id": 1,
        "email": "admin@example.com",
        "first_name": "Admin",
        "last_name": "Testerton"
    },
    "active": false,
    "match_conditions": [
        {
            "db_id": -2,
            "id": "CMC2",
            "required": [
                "A2"
            ],
            "excluded": []
        }
    ]
}

Delete a Library Countermeasure Implementation

This endpoint deletes a specific Library Countermeasure Implementation resource, as specified by the id parameter.

DELETE /api/v2/library/tasks/{task_id}/implementations/{implementation_id}/

URL Parameters

Parameter Description
task_id The id of the library countermeasure the new Library Countermeasure Implementation belongs to.
implementation_id The id of the Library Countermeasure Implementation to delete.
DELETE /api/v2/library/tasks/T1/implementations/CI1/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 204 NO CONTENT
Content-Type: application/json
{}

results matching ""

    No results matching ""