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
78e3556e
Commit
78e3556e
authored
Sep 19, 2017
by
Mitsuhiro Tanda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove performEC2DescribeInstances()
parent
8fba6dcb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
56 deletions
+0
-56
pkg/api/cloudwatch/cloudwatch.go
+0
-48
public/app/plugins/datasource/cloudwatch/datasource.js
+0
-8
No files found.
pkg/api/cloudwatch/cloudwatch.go
View file @
78e3556e
...
@@ -18,7 +18,6 @@ import (
...
@@ -18,7 +18,6 @@ import (
"github.com/aws/aws-sdk-go/aws/ec2metadata"
"github.com/aws/aws-sdk-go/aws/ec2metadata"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudwatch"
"github.com/aws/aws-sdk-go/service/cloudwatch"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/aws/aws-sdk-go/service/sts"
"github.com/aws/aws-sdk-go/service/sts"
"github.com/grafana/grafana/pkg/metrics"
"github.com/grafana/grafana/pkg/metrics"
"github.com/grafana/grafana/pkg/middleware"
"github.com/grafana/grafana/pkg/middleware"
...
@@ -78,7 +77,6 @@ func init() {
...
@@ -78,7 +77,6 @@ func init() {
"DescribeAlarms"
:
handleDescribeAlarms
,
"DescribeAlarms"
:
handleDescribeAlarms
,
"DescribeAlarmsForMetric"
:
handleDescribeAlarmsForMetric
,
"DescribeAlarmsForMetric"
:
handleDescribeAlarmsForMetric
,
"DescribeAlarmHistory"
:
handleDescribeAlarmHistory
,
"DescribeAlarmHistory"
:
handleDescribeAlarmHistory
,
"DescribeInstances"
:
handleDescribeInstances
,
}
}
}
}
...
@@ -402,52 +400,6 @@ func handleDescribeAlarmHistory(req *cwRequest, c *middleware.Context) {
...
@@ -402,52 +400,6 @@ func handleDescribeAlarmHistory(req *cwRequest, c *middleware.Context) {
c
.
JSON
(
200
,
resp
)
c
.
JSON
(
200
,
resp
)
}
}
func
handleDescribeInstances
(
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
:=
ec2
.
New
(
sess
,
cfg
)
reqParam
:=
&
struct
{
Parameters
struct
{
Filters
[]
*
ec2
.
Filter
`json:"filters"`
InstanceIds
[]
*
string
`json:"instanceIds"`
}
`json:"parameters"`
}{}
json
.
Unmarshal
(
req
.
Body
,
reqParam
)
params
:=
&
ec2
.
DescribeInstancesInput
{}
if
len
(
reqParam
.
Parameters
.
Filters
)
>
0
{
params
.
Filters
=
reqParam
.
Parameters
.
Filters
}
if
len
(
reqParam
.
Parameters
.
InstanceIds
)
>
0
{
params
.
InstanceIds
=
reqParam
.
Parameters
.
InstanceIds
}
var
resp
ec2
.
DescribeInstancesOutput
err
=
svc
.
DescribeInstancesPages
(
params
,
func
(
page
*
ec2
.
DescribeInstancesOutput
,
lastPage
bool
)
bool
{
reservations
,
_
:=
awsutil
.
ValuesAtPath
(
page
,
"Reservations"
)
for
_
,
reservation
:=
range
reservations
{
resp
.
Reservations
=
append
(
resp
.
Reservations
,
reservation
.
(
*
ec2
.
Reservation
))
}
return
!
lastPage
})
if
err
!=
nil
{
c
.
JsonApiErr
(
500
,
"Unable to call AWS API"
,
err
)
return
}
c
.
JSON
(
200
,
resp
)
}
func
HandleRequest
(
c
*
middleware
.
Context
,
ds
*
m
.
DataSource
)
{
func
HandleRequest
(
c
*
middleware
.
Context
,
ds
*
m
.
DataSource
)
{
var
req
cwRequest
var
req
cwRequest
req
.
Body
,
_
=
ioutil
.
ReadAll
(
c
.
Req
.
Request
.
Body
)
req
.
Body
,
_
=
ioutil
.
ReadAll
(
c
.
Req
.
Request
.
Body
)
...
...
public/app/plugins/datasource/cloudwatch/datasource.js
View file @
78e3556e
...
@@ -293,14 +293,6 @@ function (angular, _, moment, dateMath, kbn, templatingVariable, CloudWatchAnnot
...
@@ -293,14 +293,6 @@ function (angular, _, moment, dateMath, kbn, templatingVariable, CloudWatchAnnot
}).
then
(
function
(
r
)
{
return
transformSuggestDataFromTable
(
r
);
});
}).
then
(
function
(
r
)
{
return
transformSuggestDataFromTable
(
r
);
});
};
};
this
.
performEC2DescribeInstances
=
function
(
region
,
filters
,
instanceIds
)
{
return
this
.
awsRequest
({
region
:
region
,
action
:
'DescribeInstances'
,
parameters
:
{
filters
:
filters
,
instanceIds
:
instanceIds
}
});
};
this
.
metricFindQuery
=
function
(
query
)
{
this
.
metricFindQuery
=
function
(
query
)
{
var
region
;
var
region
;
var
namespace
;
var
namespace
;
...
...
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