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
1509b4cb
Commit
1509b4cb
authored
Mar 08, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4291 from utkarshcmu/ds-api
Pulled out the common code
parents
3af4b1ff
f20f4d13
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
19 deletions
+9
-19
pkg/api/datasources.go
+9
-19
No files found.
pkg/api/datasources.go
View file @
1509b4cb
...
...
@@ -52,24 +52,9 @@ func GetDataSourceById(c *middleware.Context) Response {
}
ds
:=
query
.
Result
dtos
:=
convertModelToDtos
(
ds
)
return
Json
(
200
,
&
dtos
.
DataSource
{
Id
:
ds
.
Id
,
OrgId
:
ds
.
OrgId
,
Name
:
ds
.
Name
,
Url
:
ds
.
Url
,
Type
:
ds
.
Type
,
Access
:
ds
.
Access
,
Password
:
ds
.
Password
,
Database
:
ds
.
Database
,
User
:
ds
.
User
,
BasicAuth
:
ds
.
BasicAuth
,
BasicAuthUser
:
ds
.
BasicAuthUser
,
BasicAuthPassword
:
ds
.
BasicAuthPassword
,
WithCredentials
:
ds
.
WithCredentials
,
IsDefault
:
ds
.
IsDefault
,
JsonData
:
ds
.
JsonData
,
})
return
Json
(
200
,
&
dtos
)
}
func
DeleteDataSource
(
c
*
middleware
.
Context
)
{
...
...
@@ -145,8 +130,13 @@ func GetDataSourceByName(c *middleware.Context) Response {
}
ds
:=
query
.
Result
dtos
:=
convertModelToDtos
(
ds
)
return
Json
(
200
,
&
dtos
)
}
return
Json
(
200
,
&
dtos
.
DataSource
{
func
convertModelToDtos
(
ds
m
.
DataSource
)
dtos
.
DataSource
{
return
dtos
.
DataSource
{
Id
:
ds
.
Id
,
OrgId
:
ds
.
OrgId
,
Name
:
ds
.
Name
,
...
...
@@ -162,5 +152,5 @@ func GetDataSourceByName(c *middleware.Context) Response {
WithCredentials
:
ds
.
WithCredentials
,
IsDefault
:
ds
.
IsDefault
,
JsonData
:
ds
.
JsonData
,
}
)
}
}
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