Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pkg/region/region_constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const (
// EU represents New Relic's EU-based production deployment.
EU Name = "EU"

// JP represents New Relic's Japan-based production deployment.
JP Name = "JP"

// Staging represents New Relic's US-based staging deployment.
// This is for internal New Relic use only.
Staging Name = "Staging"
Expand Down Expand Up @@ -46,6 +49,10 @@ var Regions = map[Name]*Region{
metricsBaseURL: "https://metric-api.eu.newrelic.com/metric/v1",
blobServiceBaseURL: "https://blob-api.service.eu.newrelic.com/v1/e",
},
JP: {
name: "JP",
nerdGraphBaseURL: "https://one.jp.newrelic.com/graphql",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Responded in above comment.

},
Staging: {
name: "Staging",
infrastructureBaseURL: "https://staging-infra-api.newrelic.com/v2",
Expand Down Expand Up @@ -83,6 +90,8 @@ func Parse(r string) (Name, error) {
return US, nil
case "eu":
return EU, nil
case "jp":
return JP, nil
case "staging":
return Staging, nil
case "local":
Expand Down
7 changes: 7 additions & 0 deletions pkg/region/region_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ func TestParse(t *testing.T) {
"Eu": EU,
"eU": EU,
"EU": EU,
"jp": JP,
"Jp": JP,
"jP": JP,
"JP": JP,
"staging": Staging,
"Staging": Staging,
"STAGING": Staging,
Expand Down Expand Up @@ -48,6 +52,7 @@ func TestRegionGet(t *testing.T) {
pairs := map[Name]*Region{
US: Regions[US],
EU: Regions[EU],
JP: Regions[JP],
Staging: Regions[Staging],
}

Expand All @@ -71,6 +76,7 @@ func TestRegionString(t *testing.T) {
pairs := map[Name]string{
US: "US",
EU: "EU",
JP: "JP",
Staging: "Staging",
Local: "Local",
}
Expand Down Expand Up @@ -137,6 +143,7 @@ func TestNerdgraphURLs(t *testing.T) {
pairs := map[Name]string{
US: "https://api.newrelic.com/graphql",
EU: "https://api.eu.newrelic.com/graphql",
JP: "https://one.jp.newrelic.com/graphql",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akifullahkhan-png - based on the existing convention with EU, should this not be https://api.jp.newrelic.com/graphql instead of https://one.jp.newrelic.com/graphql? Given this is a platform change, I'll try finding this out myself - but if we have this mentioned somewhere in the docs/the initiatives shared with us, can you please point me to such a reference? Thanks!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Staging: "https://staging-api.newrelic.com/graphql",
Local: "http://localhost:3000/graphql",
}
Expand Down
Loading