Skip to content

Latest commit

 

History

History
115 lines (96 loc) · 3.54 KB

profiles_import.rst

File metadata and controls

115 lines (96 loc) · 3.54 KB

profiles/import

POST

Imports a Profile that was exported via to-api-profiles-id-export

Note

On import of the Profile Parameters if a Parameter already exists with the same parameter-name, parameter-config-file and parameter-value it will link that to the Profile instead of creating it.

Auth. Required

Yes

Roles Required

"admin" or "operations"

Permissions Required

PROFILE:CREATE, PARAMETER:CREATE, PROFILE:READ, PARAMETER:READ

Response Type

Object

Request Structure

profile

The exported Profile

cdn

The name of the profile-cdn to which this Profile belongs

description

The Profile's profile-description

name

The Profile's profile-name

type

The Profile's profile-type

parameters

An array of Parameters in use by this Profile

config_file

The Parameter's parameter-config-file

name

parameter-name of the Parameter

value

The Parameter's parameter-value

POST /api/4.0/profiles/import HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: curl/7.62.0
Accept: */*
Cookie: mojolicious=...
Content-Type: application/json

{ "profile": {
    "name": "GLOBAL",
    "description": "Global Traffic Ops profile",
    "cdn": "ALL",
    "type": "UNK_PROFILE"
},
"parameters": [
    {
        "config_file": "global",
        "name": "tm.instance_name",
        "value": "Traffic Ops CDN"
    },
    {
        "config_file": "global",
        "name": "tm.toolname",
        "value": "Traffic Ops"
    }
]}

Response Structure

cdn

The name of the profile-cdn to which this Profile belongs

description

The Profile's profile-description

name

The Profile's profile-name

type

The Profile's profile-type

id

The Profile's profile-id

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: mzP7DVxFAGhICxqagwDyBDRea7oBZPMAx7NCDeOBVCRqlcCFFe7XL3JP58b80aaVOW/2ZGfg/jpYF70cdDfzQA==
X-Server-Name: traffic_ops_golang/
Date: Fri, 13 Sep 2019 20:14:42 GMT
Transfer-Encoding: gzip


{ "alerts": [
    {
        "level": "success",
        "text": "Profile imported [ Global ] with 2 new and 0 existing parameters"
    }
],
"response": {
    "cdn": "ALL",
    "name": "Global",
    "id": 18,
    "type": "UNK_PROFILE",
    "description": "Global Traffic Ops profile"
}}