Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
13c4ce68
Commit
13c4ce68
authored
Dec 20, 2016
by
Utkarsh Bhatnagar
Committed by
Torkel Ödegaard
Dec 20, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added name and id in response of create/update (#7016)
parent
fa010224
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
docs/sources/http_api/data_source.md
+2
-2
pkg/api/datasources.go
+2
-2
No files found.
docs/sources/http_api/data_source.md
View file @
13c4ce68
...
...
@@ -158,7 +158,7 @@ parent = "http_api"
HTTP/1.1 200
Content-Type: application/json
{"id":1,"message":"Datasource added"}
{"id":1,"message":"Datasource added"
, "name": "test_datasource"
}
## Update an existing data source
...
...
@@ -193,7 +193,7 @@ parent = "http_api"
HTTP/1.1 200
Content-Type: application/json
{"message":"Datasource updated"}
{"message":"Datasource updated"
, "id": 1, "name": "test_datasource"
}
## Delete an existing data source
...
...
pkg/api/datasources.go
View file @
13c4ce68
...
...
@@ -100,7 +100,7 @@ func AddDataSource(c *middleware.Context, cmd m.AddDataSourceCommand) {
return
}
c
.
JSON
(
200
,
util
.
DynMap
{
"message"
:
"Datasource added"
,
"id"
:
cmd
.
Result
.
Id
})
c
.
JSON
(
200
,
util
.
DynMap
{
"message"
:
"Datasource added"
,
"id"
:
cmd
.
Result
.
Id
,
"name"
:
cmd
.
Result
.
Name
})
}
func
UpdateDataSource
(
c
*
middleware
.
Context
,
cmd
m
.
UpdateDataSourceCommand
)
Response
{
...
...
@@ -117,7 +117,7 @@ func UpdateDataSource(c *middleware.Context, cmd m.UpdateDataSourceCommand) Resp
return
ApiError
(
500
,
"Failed to update datasource"
,
err
)
}
return
Json
(
200
,
util
.
DynMap
{
"message"
:
"Datasource updated"
})
return
Json
(
200
,
util
.
DynMap
{
"message"
:
"Datasource updated"
,
"id"
:
cmd
.
Id
,
"name"
:
cmd
.
Name
})
}
func
fillWithSecureJsonData
(
cmd
*
m
.
UpdateDataSourceCommand
)
error
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment