types/{{ID}}
PUT
Updates a type
- Auth. Required:
Yes
- Roles Required:
“admin” or “operations”
- Permissions Required:
TYPE:UPDATE, TYPE:READ
- Response Type:
Object
Request Structure
Name |
Description |
---|---|
ID |
The integral, unique identifier of the type being updated |
- description:
A short description of this type
- name:
The name of this type
- useInTable:
The name of the Traffic Ops database table that contains objects which are grouped, identified, or described by this type.
Note
Only types with useInTable set to ‘server’ are allowed to be updated.
PUT /api/5.0/type/3004 HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...
Content-Length: 68
Content-Type: application/json
{
"name": "Example01",
"description": "Example2",
"useInTable": "server"
}
Response Structure
- description:
A short description of this type
- id:
An integral, unique identifier for this type
- lastUpdated:
The date and time at which this type was last updated, 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.
- name:
The name of this type
- useInTable:
The name of the Traffic Ops database table that contains objects which are grouped, identified, or described by this type
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: EH8jo8OrCu79Tz9xpgT3YRyKJ/p2NcTmbS3huwtqRByHz9H6qZLQjA59RIPaVSq3ZxsU6QhTaox5nBkQ9LPSAA==
X-Server-Name: traffic_ops_golang/
Date: Wed, 26 Feb 2020 18:58:41 GMT
Content-Length: 172
{
"alerts": [
{
"text": "type was updated.",
"level": "success"
}],
"response": [
{
"id": 3004,
"lastUpdated": "2020-02-26T10:59:07.962423+05:30",
"name": "Example02",
"description": "Example"
"useInTable": "server"
}]
}
DELETE
Deletes a type
- Auth. Required:
Yes
- Roles Required:
“admin” or “operations”
- Permissions Required:
TYPE:DELETE, TYPE:READ
- Response Type:
Object
Request Structure
Name |
Description |
---|---|
ID |
The integral, unique identifier of the type being deleted |
Note
Only types with useInTable set to “server” are allowed to be deleted.
DELETE /api/5.0/type/3004 HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...
Content-Length: 0
Response Structure
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: EH8jo8OrCu79Tz9xpgT3YRyKJ/p2NcTmbS3huwtqRByHz9H6qZLQjA59RIPaVSq3ZxsU6QhTaox5nBkQ9LPSAA==
X-Server-Name: traffic_ops_golang/
Date: Wed, 26 Feb 2020 18:58:41 GMT
Content-Length: 84
{
"alerts": [
{
"text": "type was deleted.",
"level": "success"
}],
}