Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
phpipam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package 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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vlbox
phpipam
Commits
52453ecc
Commit
52453ecc
authored
May 6, 2019
by
Gary Allan
Browse files
Options
Downloads
Patches
Plain Diff
api: Extend Tools API controller with customers subcontroller. #2518
parent
49c026c2
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/controllers/Tools.php
+8
-6
8 additions, 6 deletions
api/controllers/Tools.php
with
8 additions
and
6 deletions
api/controllers/Tools.php
+
8
−
6
View file @
52453ecc
...
@@ -135,7 +135,8 @@ class Tools_controller extends Common_api_functions {
...
@@ -135,7 +135,8 @@ class Tools_controller extends Common_api_functions {
"scanAgents"
=>
"scanagents"
,
"scanAgents"
=>
"scanagents"
,
"locations"
=>
"locations"
,
"locations"
=>
"locations"
,
"racks"
=>
"racks"
,
"racks"
=>
"racks"
,
"nat"
=>
"nat"
"nat"
=>
"nat"
,
"customers"
=>
"customers"
);
);
}
}
...
@@ -156,7 +157,8 @@ class Tools_controller extends Common_api_functions {
...
@@ -156,7 +157,8 @@ class Tools_controller extends Common_api_functions {
"scanAgents"
=>
array
(
"id2"
),
"scanAgents"
=>
array
(
"id2"
),
"locations"
=>
array
(
"id2"
,
"id3"
),
"locations"
=>
array
(
"id2"
,
"id3"
),
"racks"
=>
array
(
"id2"
,
"id3"
),
"racks"
=>
array
(
"id2"
,
"id3"
),
"nat"
=>
array
(
"id2"
,
"id3"
)
"nat"
=>
array
(
"id2"
,
"id3"
),
"customers"
=>
array
(
"id2"
)
);
);
}
}
...
@@ -388,8 +390,8 @@ class Tools_controller extends Common_api_functions {
...
@@ -388,8 +390,8 @@ class Tools_controller extends Common_api_functions {
# rewrite tool controller _params
# rewrite tool controller _params
$table_name
=
$this
->
rewrite_tool_input_params
();
$table_name
=
$this
->
rewrite_tool_input_params
();
# Get coordinates if
locations
# Get coordinates if
address is set
if
(
$table_name
==
"locations"
)
if
(
key_exists
(
'address'
,
$this
->
_params
)
&&
in_array
(
'lat'
,
$this
->
valid_keys
)
)
$this
->
format_location
();
$this
->
format_location
();
# check for valid keys
# check for valid keys
...
@@ -439,8 +441,8 @@ class Tools_controller extends Common_api_functions {
...
@@ -439,8 +441,8 @@ class Tools_controller extends Common_api_functions {
# rewrite tool controller _params
# rewrite tool controller _params
$table_name
=
$this
->
rewrite_tool_input_params
();
$table_name
=
$this
->
rewrite_tool_input_params
();
# Get coordinates if
locations
# Get coordinates if
address is changed
if
(
$table_name
==
"locations"
)
if
(
key_exists
(
'address'
,
$this
->
_params
)
&&
in_array
(
'lat'
,
$this
->
valid_keys
)
)
$this
->
format_location
();
$this
->
format_location
();
# validate and prepare keys
# validate and prepare keys
...
...
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