ocket8888 commented on a change in pull request #3930: Rewrite profile import to Go URL: https://github.com/apache/trafficcontrol/pull/3930#discussion_r331102672
########## File path: docs/source/api/profiles_import.rst ########## @@ -0,0 +1,118 @@ +.. +.. +.. Licensed under the Apache License, Version 2.0 (the "License"); +.. you may not use this file except in compliance with the License. +.. You may obtain a copy of the License at +.. +.. http://www.apache.org/licenses/LICENSE-2.0 +.. +.. Unless required by applicable law or agreed to in writing, software +.. distributed under the License is distributed on an "AS IS" BASIS, +.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +.. See the License for the specific language governing permissions and +.. limitations under the License. +.. + +.. _to-api-profiles-import: + +******************* +``profiles/import`` +******************* + +``POST`` +======== + +Imports a :term:`Profile` that was exported via :ref:`to-api-profiles-id-export` + +.. note:: On import of the :term:`Profile` :term:`Parameters` if a :term:`Parameter` already exists with the same :ref:`parameter-name`, :ref:`parameter-config-file` and :ref:`parameter-value` it will link that to the :term:`Profile` instead of creating it. + +:Auth. Required: Yes +:Roles Required: "admin" or "operations" +:Response Type: Object + +Request Structure +----------------- + +:profile: The exported :term:`Profile` + + :cdn: The name of the :ref:`profile-cdn` to which this :term:`Profile` belongs + :description: The :term:`Profile`'s :ref:`profile-description` + :name: The :term:`Profile`'s :ref:`profile-name` + :type: The :term:`Profile`'s :ref:`profile-type` + +:parameters: An array of :term:`Parameters` in use by this :term:`Profile` + + :config_file: The :term:`Parameter`'s :ref:`parameter-config-file` + :name: :ref:`parameter-name` of the :term:`Parameter` + :value: The :term:`Parameter`'s :ref:`parameter-value` + +.. code-block:: http + :caption: Request Example + + POST /api/1.1/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 :ref:`profile-cdn` to which this :term:`Profile` belongs + :description: The :term:`Profile`'s :ref:`profile-description` + :name: The :term:`Profile`'s :ref:`profile-name` + :type: The :term:`Profile`'s :ref:`profile-type` + :id: The :term:`Profile`'s :ref:`profile-id` Review comment: These don't need to be indented ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
