mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-08-27 12:30:13 +03:00
Merge branch '2.2' into 3.1
# Conflicts: # gns3server/handlers/api/controller/template_handler.py # tests/handlers/api/controller/test_template.py
This commit is contained in:
commit
d54b16df53
@ -10,7 +10,7 @@ jobs:
|
||||
name: Add issue to project
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/add-to-project@v1.0.1
|
||||
- uses: actions/add-to-project@v2
|
||||
with:
|
||||
project-url: https://github.com/orgs/GNS3/projects/3
|
||||
github-token: ${{ secrets.ADD_NEW_ISSUES_TO_PROJECT }}
|
||||
|
||||
6
.github/workflows/codeql-analysis.yml
vendored
6
.github/workflows/codeql-analysis.yml
vendored
@ -56,11 +56,11 @@ jobs:
|
||||
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v7
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
uses: github/codeql-action/init@v4
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
build-mode: ${{ matrix.build-mode }}
|
||||
@ -88,6 +88,6 @@ jobs:
|
||||
exit 1
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
uses: github/codeql-action/analyze@v4
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
||||
|
||||
2
.github/workflows/docker-build.yml
vendored
2
.github/workflows/docker-build.yml
vendored
@ -13,7 +13,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v4
|
||||
|
||||
@ -12,11 +12,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: "gh-pages"
|
||||
- uses: actions/setup-python@v5
|
||||
- uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: 3.12
|
||||
- name: Merge changes from 3.0 branch
|
||||
|
||||
4
.github/workflows/testing.yml
vendored
4
.github/workflows/testing.yml
vendored
@ -21,9 +21,9 @@ jobs:
|
||||
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v7
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Display Python version
|
||||
|
||||
17
docs/api/examples/controller_get_templateidbaseconfig.txt
Normal file
17
docs/api/examples/controller_get_templateidbaseconfig.txt
Normal file
@ -0,0 +1,17 @@
|
||||
curl -i -X 'http://localhost:3080/v2/templates/19021f99-e36f-394d-b4a1-8aaa902ab9cc/base-config/vpcs_base_config.txt'
|
||||
|
||||
GET /v2/templates/19021f99-e36f-394d-b4a1-8aaa902ab9cc/base-config/vpcs_base_config.txt HTTP/1.1
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Connection: close
|
||||
X-Route: /v2/templates/{template_id}/base-config/{filename}
|
||||
Server: Python/3.14 GNS3/2.2.60.dev1+713dbb7f
|
||||
Content-Type: application/json
|
||||
Content-Length: 144
|
||||
Date: Mon, 18 May 2026 18:34:10 GMT
|
||||
|
||||
{
|
||||
"content": "# test config\n\ndhcp\n",
|
||||
"filename": "vpcs_base_config.txt",
|
||||
"template_id": "19021f99-e36f-394d-b4a1-8aaa902ab9cc"
|
||||
}
|
||||
44
docs/api/examples/controller_get_templatesbaseconfigs.txt
Normal file
44
docs/api/examples/controller_get_templatesbaseconfigs.txt
Normal file
@ -0,0 +1,44 @@
|
||||
curl -i -X 'http://localhost:3080/v2/templates/base-configs'
|
||||
|
||||
GET /v2/templates/base-configs HTTP/1.1
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Connection: close
|
||||
X-Route: /v2/templates/base-configs
|
||||
Server: Python/3.14 GNS3/2.2.60.dev1+713dbb7f
|
||||
Content-Type: application/json
|
||||
Content-Length: 576
|
||||
Date: Mon, 18 May 2026 18:28:53 GMT
|
||||
|
||||
[
|
||||
{
|
||||
"filename": "config1.txt"
|
||||
},
|
||||
{
|
||||
"filename": "config2.txt"
|
||||
},
|
||||
{
|
||||
"filename": "ios_base_startup-config.txt"
|
||||
},
|
||||
{
|
||||
"filename": "ios_etherswitch_startup-config.txt"
|
||||
},
|
||||
{
|
||||
"filename": "iou_l2_base_startup-config.txt"
|
||||
},
|
||||
{
|
||||
"filename": "iou_l3_base_startup-config.txt"
|
||||
},
|
||||
{
|
||||
"filename": "test_config.txt"
|
||||
},
|
||||
{
|
||||
"filename": "update_test.txt"
|
||||
},
|
||||
{
|
||||
"filename": "vpcs_base_config.txt"
|
||||
},
|
||||
{
|
||||
"filename": "vpcs_base_config2.txt"
|
||||
}
|
||||
]
|
||||
17
docs/api/examples/controller_put_templateidbaseconfig.txt
Normal file
17
docs/api/examples/controller_put_templateidbaseconfig.txt
Normal file
@ -0,0 +1,17 @@
|
||||
curl -i -X 'http://localhost:3080/v2/templates/19021f99-e36f-394d-b4a1-8aaa902ab9cc/base-config/vpcs_base_config.txt'
|
||||
|
||||
PUT /v2/templates/19021f99-e36f-394d-b4a1-8aaa902ab9cc/base-config/vpcs_base_config.txt HTTP/1.1
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Connection: close
|
||||
X-Route: /v2/templates/{template_id}/base-config/{filename}
|
||||
Server: Python/3.14 GNS3/2.2.60.dev1+713dbb7f
|
||||
Content-Type: application/json
|
||||
Content-Length: 144
|
||||
Date: Mon, 18 May 2026 18:37:57 GMT
|
||||
|
||||
{
|
||||
"content": "# test config\n\ndhcp\n",
|
||||
"filename": "vpcs_base_config.txt",
|
||||
"template_id": "19021f99-e36f-394d-b4a1-8aaa902ab9cc"
|
||||
}
|
||||
38
docs/api/v2/controller/template/templatesbaseconfigs.rst
Normal file
38
docs/api/v2/controller/template/templatesbaseconfigs.rst
Normal file
@ -0,0 +1,38 @@
|
||||
GET /v2/templates/base-configs
|
||||
------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
GET /v2/templates/base-configs
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
List all available base configuration files
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **200**: List of base configuration files returned
|
||||
|
||||
Output
|
||||
*******
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>filename</td>
|
||||
<td>string</td>
|
||||
<td>Name of the base configuration file</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
Sample session
|
||||
***************
|
||||
|
||||
.. literalinclude:: ../../../examples/controller_get_templatesbaseconfigs.txt
|
||||
@ -0,0 +1,90 @@
|
||||
/v2/templates/{template_id}/base-config/{filename}
|
||||
------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
GET /v2/templates/**{template_id}**/base-configs/**{filename}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
List all available base configuration files
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **200**: List of base configuration files returned
|
||||
|
||||
Output
|
||||
*******
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>filename</td>
|
||||
<td>string</td>
|
||||
<td>Name of the base configuration file</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
Sample session
|
||||
***************
|
||||
|
||||
.. literalinclude:: ../../../examples/controller_get_templateidbaseconfig.txt
|
||||
|
||||
|
||||
PUT /v2/templates/**{template_id}**/base-config/**{filename}**
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Update base configuration file content
|
||||
|
||||
Response status codes
|
||||
**********************
|
||||
- **200**: File updated
|
||||
- **404**: File not found
|
||||
|
||||
Input
|
||||
*******
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Mandatory</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
|
||||
<tr><td>content</td><td>✔</td><td>string</td><td>New file content</td></tr>
|
||||
|
||||
</table>
|
||||
|
||||
Output
|
||||
*******
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Mandatory</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
|
||||
<tr><td>template_id</td><td>✔</td><td>string</td><td>Template UUID</td></tr>
|
||||
<tr><td>filename</td><td>✔</td><td>string</td><td>Base configuration filename</td></tr>
|
||||
<tr><td>content</td><td>✔</td><td>string</td><td>Updated file content</td></tr>
|
||||
|
||||
</table>
|
||||
|
||||
Sample session
|
||||
***************
|
||||
|
||||
.. literalinclude:: ../../../examples/controller_put_templateidbaseconfig.txt
|
||||
Loading…
x
Reference in New Issue
Block a user