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
b0cb6d6d
Commit
b0cb6d6d
authored
Nov 07, 2015
by
Nick Owens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pkg/api/cloudwatch: fix api client construction against aws-sdk-go v0.10.2
parent
56e20822
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
pkg/api/cloudwatch/cloudwatch.go
+16
-5
No files found.
pkg/api/cloudwatch/cloudwatch.go
View file @
b0cb6d6d
...
@@ -9,6 +9,7 @@ import (
...
@@ -9,6 +9,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds"
"github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds"
"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/ec2"
"github.com/grafana/grafana/pkg/middleware"
"github.com/grafana/grafana/pkg/middleware"
...
@@ -45,10 +46,13 @@ func handleGetMetricStatistics(req *cwRequest, c *middleware.Context) {
...
@@ -45,10 +46,13 @@ func handleGetMetricStatistics(req *cwRequest, c *middleware.Context) {
&
credentials
.
SharedCredentialsProvider
{
Filename
:
""
,
Profile
:
req
.
DataSource
.
Database
},
&
credentials
.
SharedCredentialsProvider
{
Filename
:
""
,
Profile
:
req
.
DataSource
.
Database
},
&
ec2rolecreds
.
EC2RoleProvider
{
ExpiryWindow
:
5
*
time
.
Minute
},
&
ec2rolecreds
.
EC2RoleProvider
{
ExpiryWindow
:
5
*
time
.
Minute
},
})
})
svc
:=
cloudwatch
.
New
(
&
aws
.
Config
{
cfg
:=
&
aws
.
Config
{
Region
:
aws
.
String
(
req
.
Region
),
Region
:
aws
.
String
(
req
.
Region
),
Credentials
:
creds
,
Credentials
:
creds
,
})
}
svc
:=
cloudwatch
.
New
(
session
.
New
(
cfg
),
cfg
)
reqParam
:=
&
struct
{
reqParam
:=
&
struct
{
Parameters
struct
{
Parameters
struct
{
...
@@ -89,10 +93,13 @@ func handleListMetrics(req *cwRequest, c *middleware.Context) {
...
@@ -89,10 +93,13 @@ func handleListMetrics(req *cwRequest, c *middleware.Context) {
&
credentials
.
SharedCredentialsProvider
{
Filename
:
""
,
Profile
:
req
.
DataSource
.
Database
},
&
credentials
.
SharedCredentialsProvider
{
Filename
:
""
,
Profile
:
req
.
DataSource
.
Database
},
&
ec2rolecreds
.
EC2RoleProvider
{
ExpiryWindow
:
5
*
time
.
Minute
},
&
ec2rolecreds
.
EC2RoleProvider
{
ExpiryWindow
:
5
*
time
.
Minute
},
})
})
svc
:=
cloudwatch
.
New
(
&
aws
.
Config
{
cfg
:=
&
aws
.
Config
{
Region
:
aws
.
String
(
req
.
Region
),
Region
:
aws
.
String
(
req
.
Region
),
Credentials
:
creds
,
Credentials
:
creds
,
})
}
svc
:=
cloudwatch
.
New
(
session
.
New
(
cfg
),
cfg
)
reqParam
:=
&
struct
{
reqParam
:=
&
struct
{
Parameters
struct
{
Parameters
struct
{
...
@@ -119,7 +126,11 @@ func handleListMetrics(req *cwRequest, c *middleware.Context) {
...
@@ -119,7 +126,11 @@ func handleListMetrics(req *cwRequest, c *middleware.Context) {
}
}
func
handleDescribeInstances
(
req
*
cwRequest
,
c
*
middleware
.
Context
)
{
func
handleDescribeInstances
(
req
*
cwRequest
,
c
*
middleware
.
Context
)
{
svc
:=
ec2
.
New
(
&
aws
.
Config
{
Region
:
aws
.
String
(
req
.
Region
)})
cfg
:=
&
aws
.
Config
{
Region
:
aws
.
String
(
req
.
Region
),
}
svc
:=
ec2
.
New
(
session
.
New
(
cfg
),
cfg
)
reqParam
:=
&
struct
{
reqParam
:=
&
struct
{
Parameters
struct
{
Parameters
struct
{
...
...
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