multiple_servers_capabilities

New in version 4.1.

POST

Inserts a list of Server Capability names associated to a server and vice versa i.e insert a list of Server ids associated to a server capability.

Auth. Required:

Yes

Roles Required:

“admin” or “operations”

Permissions Required:

SERVER:READ, SERVER:CREATE, SERVER-CAPABILITY:READ, SERVER-CAPABILITY:CREATE

Response Type:

Object

Request Structure

serverIds:

List of Server ids (integral, unique identifier) associated with a Server Capability

serverCapabilities:

List of Server Capability names to associate with a Server id

pageType:

To determine which configuration (server or server capabilities) is requesting association. Only two values are permitted: server or sc (short for server capability). If server is chosen, it implies that multiple server capabilities are to be associated with a given server id. If sc is chosen, it implies that multiple server ids are to be associated with a given server capability.

#861 Request Example1
POST /api/4.1/multiple_servers_capabilities/ HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...
Content-Length: 84
Content-Type: application/json

{
    "serverIds": [1],
    "serverCapabilities": ["test", "disk"]
    "pageType": "server"
}
#862 Request Example2
POST /api/4.1/multiple_servers_capabilities/ HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...
Content-Length: 84
Content-Type: application/json

{
    "serverIds": [2, 3]
    "serverCapabilities": ["eas"],
    "pageType": "sc"
}

Response Structure

serverId:

List of Server ids (integral, unique identifier) associated with a server capability.

serverCapabilities:

List of Server Capability names to be associated with a Server id.

#863 Response Example1
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, 8 Aug 2022 22:40:54 GMT; Max-Age=3600; HttpOnly
Whole-Content-Sha512: eQrl48zWids0kDpfCYmmtYMpegjnFxfOVvlBYxxLSfp7P7p6oWX4uiC+/Cfh2X9i3G+MQ36eH95gukJqOBOGbQ==
X-Server-Name: traffic_ops_golang/
Date: Mon, 08 Aug 2022 16:15:11 GMT
Content-Length: 157

{
    "alerts": [{
        "text": "Multiple Server Capabilities assigned to a server",
        "level": "success"
    }],
    "response": {
        "serverIds": [1],
        "serverCapabilities": ["test", "disk"]
    }
}
#864 Response Example2
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, 8 Aug 2022 22:40:54 GMT; Max-Age=3600; HttpOnly
Whole-Content-Sha512: eQrl48zWids0kDpfCYmmtYMpegjnFxfOVvlBYxxLSfp7P7p6oWX4uiC+/Cfh2X9i3G+MQ36eH95gukJqOBOGbQ==
X-Server-Name: traffic_ops_golang/
Date: Mon, 08 Aug 2022 16:15:11 GMT
Content-Length: 157

{
    "alerts": [{
        "text": "Multiple Servers assigned to a capability",
        "level": "success"
    }],
    "response": {
        "serverIds": [2, 3]
        "serverCapabilities": ["eas"],
    }
}

DELETE

Deletes a list of Server Capability names associated to a server and vice versa i.e. deletes a list of Server ids associated to a server capability.

Auth. Required:

Yes

Roles Required:

“admin” or “operations”

Permissions Required:

SERVER:READ, SERVER:DELETE, SERVER-CAPABILITY:READ, SERVER-CAPABILITY:DELETE

Response Type:

Object

Request Structure

serverIds:

List of Server ids (integral, unique identifier) associated with a Server Capability

serverCapabilities:

List of Server Capability names to associate with a Server id

pageType:

To determine which configuration (server or server capabilities) is requesting deletion. Only two values are permitted: server or sc (short for server capability). If server is chosen, it implies that multiple server capabilities are to be deleted for a given server id. If sc is chosen, it implies that multiple server ids are to be deleted for a given server capability.

#865 Request Example
DELETE /api/4.1/multiple_servers_capabilities/ HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...
Content-Length: 84
Content-Type: application/json

{
    "serverIds": [2, 3]
    "serverCapabilities": ["eas"],
    "pageType": "sc"
}

Response Structure

serverId:

List of Server ids (integral, unique identifier) associated with a server capability.

serverCapabilities:

List of Server Capability names to be associated with a Server id.

#866 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, 8 Aug 2022 22:40:54 GMT; Max-Age=3600; HttpOnly
Whole-Content-Sha512: eQrl48zWids0kDpfCYmmtYMpegjnFxfOVvlBYxxLSfp7P7p6oWX4uiC+/Cfh2X9i3G+MQ36eH95gukJqOBOGbQ==
X-Server-Name: traffic_ops_golang/
Date: Mon, 08 Aug 2022 16:15:11 GMT
Content-Length: 157

{
    "alerts": [{
        "text": "Removed multiple servers from capabilities or multiple servers to a capability",
        "level": "success"
    }],
    "response": {
        "serverIds": [2, 3]
        "serverCapabilities": ["eas"],
    }
}