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
f66e1c02
Commit
f66e1c02
authored
Sep 13, 2017
by
Mitsuhiro Tanda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove obsolete GetMetricStatistics()
parent
01d2aa8a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
53 deletions
+0
-53
pkg/api/cloudwatch/cloudwatch.go
+0
-53
No files found.
pkg/api/cloudwatch/cloudwatch.go
View file @
f66e1c02
...
@@ -74,7 +74,6 @@ func (req *cwRequest) GetDatasourceInfo() *DatasourceInfo {
...
@@ -74,7 +74,6 @@ func (req *cwRequest) GetDatasourceInfo() *DatasourceInfo {
func
init
()
{
func
init
()
{
actionHandlers
=
map
[
string
]
actionHandler
{
actionHandlers
=
map
[
string
]
actionHandler
{
"GetMetricStatistics"
:
handleGetMetricStatistics
,
"ListMetrics"
:
handleListMetrics
,
"ListMetrics"
:
handleListMetrics
,
"DescribeAlarms"
:
handleDescribeAlarms
,
"DescribeAlarms"
:
handleDescribeAlarms
,
"DescribeAlarmsForMetric"
:
handleDescribeAlarmsForMetric
,
"DescribeAlarmsForMetric"
:
handleDescribeAlarmsForMetric
,
...
@@ -219,58 +218,6 @@ func getAwsConfig(req *cwRequest) (*aws.Config, error) {
...
@@ -219,58 +218,6 @@ func getAwsConfig(req *cwRequest) (*aws.Config, error) {
return
cfg
,
nil
return
cfg
,
nil
}
}
func
handleGetMetricStatistics
(
req
*
cwRequest
,
c
*
middleware
.
Context
)
{
cfg
,
err
:=
getAwsConfig
(
req
)
if
err
!=
nil
{
c
.
JsonApiErr
(
500
,
"Unable to call AWS API"
,
err
)
return
}
sess
,
err
:=
session
.
NewSession
(
cfg
)
if
err
!=
nil
{
c
.
JsonApiErr
(
500
,
"Unable to call AWS API"
,
err
)
return
}
svc
:=
cloudwatch
.
New
(
sess
,
cfg
)
reqParam
:=
&
struct
{
Parameters
struct
{
Namespace
string
`json:"namespace"`
MetricName
string
`json:"metricName"`
Dimensions
[]
*
cloudwatch
.
Dimension
`json:"dimensions"`
Statistics
[]
*
string
`json:"statistics"`
ExtendedStatistics
[]
*
string
`json:"extendedStatistics"`
StartTime
int64
`json:"startTime"`
EndTime
int64
`json:"endTime"`
Period
int64
`json:"period"`
}
`json:"parameters"`
}{}
json
.
Unmarshal
(
req
.
Body
,
reqParam
)
params
:=
&
cloudwatch
.
GetMetricStatisticsInput
{
Namespace
:
aws
.
String
(
reqParam
.
Parameters
.
Namespace
),
MetricName
:
aws
.
String
(
reqParam
.
Parameters
.
MetricName
),
Dimensions
:
reqParam
.
Parameters
.
Dimensions
,
StartTime
:
aws
.
Time
(
time
.
Unix
(
reqParam
.
Parameters
.
StartTime
,
0
)),
EndTime
:
aws
.
Time
(
time
.
Unix
(
reqParam
.
Parameters
.
EndTime
,
0
)),
Period
:
aws
.
Int64
(
reqParam
.
Parameters
.
Period
),
}
if
len
(
reqParam
.
Parameters
.
Statistics
)
!=
0
{
params
.
Statistics
=
reqParam
.
Parameters
.
Statistics
}
if
len
(
reqParam
.
Parameters
.
ExtendedStatistics
)
!=
0
{
params
.
ExtendedStatistics
=
reqParam
.
Parameters
.
ExtendedStatistics
}
resp
,
err
:=
svc
.
GetMetricStatistics
(
params
)
if
err
!=
nil
{
c
.
JsonApiErr
(
500
,
"Unable to call AWS API"
,
err
)
return
}
metrics
.
M_Aws_CloudWatch_GetMetricStatistics
.
Inc
()
c
.
JSON
(
200
,
resp
)
}
func
handleListMetrics
(
req
*
cwRequest
,
c
*
middleware
.
Context
)
{
func
handleListMetrics
(
req
*
cwRequest
,
c
*
middleware
.
Context
)
{
cfg
,
err
:=
getAwsConfig
(
req
)
cfg
,
err
:=
getAwsConfig
(
req
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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