Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Commits
ec8a92eb
Verified
Commit
ec8a92eb
authored
9 months ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
Show current license usage when updating Kentik license of a router
parent
5f94da6e
No related branches found
No related tags found
No related merge requests found
Pipeline
#89099
passed
9 months ago
Stage: tox
Stage: documentation
Stage: sonarqube
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gso/services/kentik_client.py
+36
-1
36 additions, 1 deletion
gso/services/kentik_client.py
gso/services/lso_client.py
+2
-0
2 additions, 0 deletions
gso/services/lso_client.py
gso/workflows/router/modify_kentik_license.py
+5
-1
5 additions, 1 deletion
gso/workflows/router/modify_kentik_license.py
with
43 additions
and
2 deletions
gso/services/kentik_client.py
+
36
−
1
View file @
ec8a92eb
...
...
@@ -109,7 +109,42 @@ class KentikClient:
return
{}
def
get_plans
(
self
)
->
list
[
dict
[
str
,
Any
]]:
"""
Get all Kentik plans available.
"""
"""
Get all Kentik plans available.
Returns a list of ``plans`` that each have the following shape:
.. vale off
.. code-block:: json
"
plan
"
: {
"
active
"
: true,
"
bgp_enabled
"
: true,
"
cdate
"
"
1970-01-01T01:01:01.000Z
"
,
"
company_id
"
: 111111,
"
description
"
:
"
A description of this plan
"
,
"
deviceTypes
"
: [
{
"
device_type
"
:
"
router
"
},
{
"
device_type
"
:
"
host-nprobe-dns-www
"
}
],
"
devices
"
: [
{
"
id
"
:
"
111111
"
,
"
device_name
"
:
"
rt0.city.tld.internal
"
,
"
device_type
"
:
"
router
"
},
],
"
edate
"
:
"
2999-01-01T09:09:09.000Z
"
,
"
fast_retention
"
: 10,
"
full_retention
"
: 5,
"
id
"
: 11111,
"
max_bigdata_fps
"
: 100,
"
max_devices
"
: 9001,
"
max_fps
"
: 200,
"
name
"
:
"
KENTIK-PLAN-01
"
,
"
metadata
"
: {},
}
.. vale on
"""
return
self
.
_send_request
(
"
GET
"
,
"
v5/plans
"
)[
"
plans
"
]
def
get_plan
(
self
,
plan_id
:
int
)
->
dict
[
str
,
Any
]:
...
...
This diff is collapsed.
Click to expand it.
gso/services/lso_client.py
+
2
−
0
View file @
ec8a92eb
...
...
@@ -60,6 +60,7 @@ def execute_playbook(
For example, an inventory consisting of two hosts, which each a unique host variable assigned to them looks as
follows:
.. vale off
.. code-block:: json
"
inventory
"
: {
...
...
@@ -74,6 +75,7 @@ def execute_playbook(
}
}
}
.. vale on
.. warning::
Note the fact that the collection of all hosts is a dictionary, and not a list of strings. Ansible expects each
...
...
This diff is collapsed.
Click to expand it.
gso/workflows/router/modify_kentik_license.py
+
5
−
1
View file @
ec8a92eb
...
...
@@ -22,7 +22,11 @@ logger = logging.getLogger()
def
_initial_input_form
(
subscription_id
:
UUIDstr
)
->
FormGenerator
:
router
=
Router
.
from_subscription
(
subscription_id
)
active_kentik_plans
=
{
str
(
plan
[
"
id
"
]):
plan
[
"
name
"
]
for
plan
in
KentikClient
().
get_plans
()
if
plan
[
"
active
"
]}
active_kentik_plans
=
{
str
(
plan
[
"
id
"
]):
f
"
{
plan
[
"
name
"
]
}
- (
{
len
(
plan
[
"
devices
"
])
}
/
{
plan
[
"
max_devices
"
]
}
)
"
for
plan
in
KentikClient
().
get_plans
()
if
plan
[
"
active
"
]
}
available_kentik_plans
=
Choice
(
"
Select a Kentik license
"
,
zip
(
active_kentik_plans
.
keys
(),
active_kentik_plans
.
items
(),
strict
=
True
),
# type: ignore[arg-type]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment