service_categories/{{name}}

PUT

Update a service category.

Auth. Required:

Yes

Roles Required:

“admin” or “operations”

Permissions Required:

SERVICE-CATEGORY:UPDATE, SERVICE-CATEGORY:READ

Response Type:

Object

Request Structure

name:

The Service Category’s new name

Table 595 Request Path Parameters

Name

Description

name

The current name of the Service Category

#1476 Request Example
PUT /api/5.0/service_categories/sc-name HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...
Content-Length: 48
Content-Type: application/json

{
    "name": "New Name",
}

Response Structure

name:

This Service Category’s name

lastUpdated:

The date and time at which this Service Category was last modified, in RFC 3339 format

Changed in version 5.0: Prior to version 5.0 of the API, this field was in Traffic Ops’s Custom Date/Time Format.

#1477 Response Example
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Set-Cookie, Cookie
Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE
Access-Control-Allow-Origin: *
Content-Type: application/json
Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 18 Nov 2019 17:40:54 GMT; Max-Age=3600; HttpOnly
Whole-Content-Sha512: +pJm4c3O+JTaSXNt+LP+u240Ba/SsvSSDOQ4rDc6hcyZ0FIL+iY/WWrMHhpLulRGKGY88bM4YPCMaxGn3FZ9yQ==
X-Server-Name: traffic_ops_golang/
Date: Wed, 29 Mar 2023 15:58:37 GMT
Content-Length: 189

{
    "alerts": [
        {
            "text": "Service Category was updated.",
            "level": "success"
        }
    ],
    "response": {
        "lastUpdated": "2023-03-29T21:28:37.884457+05:30",
        "name": "New Name"
    }
}

DELETE

Deletes a specific Service Category.

Auth. Required:

Yes

Roles Required:

“admin” or “operations”

Permissions Required:

SERVICE-CATEGORY:DELETE, SERVICE-CATEGORY:READ

Response Type:

undefined

Request Structure

Table 596 Request Path Parameters

Name

Description

name

The current name of the Service Category to be deleted

#1478 Request Example
DELETE /api/5.0/service_categories/my-service-category HTTP/1.1
User-Agent: python-requests/2.23.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Cookie: mojolicious=...
Content-Length: 0

Response Structure

#1479 Response Example
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Set-Cookie, Cookie
Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE
Access-Control-Allow-Origin: *
Content-Encoding: gzip
Content-Type: application/json
Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 17 Aug 2020 16:13:31 GMT; Max-Age=3600; HttpOnly
Whole-Content-Sha512: yErJobzG9IA0khvqZQK+Yi7X4pFVvOqxn6PjrdzN5DnKVm/K8Kka3REul1XmKJnMXVRY8RayoEVGDm16mBFe4Q==
X-Server-Name: traffic_ops_golang/
Date: Wed, 29 Mar 2023 15:58:37 GMT
Content-Length: 103

{
    "alerts": [
        {
            "text": "my-service-category was deleted.",
            "level": "success"
        }
    ]
}