From caa26f594e310d1e828d7a5e17cb3e004e9cf1d8 Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Thu, 14 Jan 2016 14:40:12 -0800 Subject: [PATCH 1/4] Added Orgs API --- docs/sources/reference/http_api.md | 58 ++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/docs/sources/reference/http_api.md b/docs/sources/reference/http_api.md index 15e7a06f3b8..7cdd8a872d5 100644 --- a/docs/sources/reference/http_api.md +++ b/docs/sources/reference/http_api.md @@ -500,6 +500,64 @@ Proxies all calls to the actual datasource. "name":"Main Org." } +### Get Organisation by Id + +`GET /api/orgs/:orgId` + +**Example Request**: + + GET /api/orgs/1 HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + +**Example Response**: + + HTTP/1.1 200 + Content-Type: application/json + + { + "id":1, + "name":"Main Org.", + "address":{ + "address1":"", + "address2":"", + "city":"", + "zipCode":"", + "state":"", + "country":"" + } + } + +### Get Organisation by Name + +`GET /api/orgs/name/:orgName` + +**Example Request**: + + GET /api/orgs/name/Main%20Org%2E HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + +**Example Response**: + + HTTP/1.1 200 + Content-Type: application/json + + { + "id":1, + "name":"Main Org.", + "address":{ + "address1":"", + "address2":"", + "city":"", + "zipCode":"", + "state":"", + "country":"" + } + } + ### Update current Organisation `PUT /api/org` From 83346a29aa3d0fdddcd4e8751eb617be3b98de42 Mon Sep 17 00:00:00 2001 From: bergquist Date: Fri, 15 Jan 2016 11:01:56 +0100 Subject: [PATCH 2/4] fix(plugins): scans default plugin path --- pkg/plugins/plugins.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/plugins/plugins.go b/pkg/plugins/plugins.go index 1b945141f6a..5388291712b 100644 --- a/pkg/plugins/plugins.go +++ b/pkg/plugins/plugins.go @@ -45,6 +45,7 @@ func Init() error { } scan(path.Join(setting.StaticRootPath, "app/plugins")) + scan(path.Join(setting.StaticRootPath, setting.PluginsPath)) checkPluginPaths() // checkDependencies() return nil From 01d47fb280d9828186557c92fbc34703beebc925 Mon Sep 17 00:00:00 2001 From: bergquist Date: Fri, 15 Jan 2016 11:22:41 +0100 Subject: [PATCH 3/4] fix(plugins): fix for default plugin dif --- pkg/plugins/plugins.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/plugins/plugins.go b/pkg/plugins/plugins.go index 5388291712b..dad7572f446 100644 --- a/pkg/plugins/plugins.go +++ b/pkg/plugins/plugins.go @@ -45,7 +45,7 @@ func Init() error { } scan(path.Join(setting.StaticRootPath, "app/plugins")) - scan(path.Join(setting.StaticRootPath, setting.PluginsPath)) + scan(setting.PluginsPath) checkPluginPaths() // checkDependencies() return nil From f6a3b53fb5cf7c05543f9b982d033bc903ed6f13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 15 Jan 2016 11:22:54 +0100 Subject: [PATCH 4/4] fix(firefox): fixed js issue that made master build break in firefox --- public/app/core/services/dynamic_directive_srv.ts | 4 ++-- public/app/features/annotations/query_editor.ts | 2 +- public/app/features/datasources/config_view.ts | 2 +- public/app/features/panel/query_editor.ts | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/public/app/core/services/dynamic_directive_srv.ts b/public/app/core/services/dynamic_directive_srv.ts index d6cc8a19184..a0ee130fa87 100644 --- a/public/app/core/services/dynamic_directive_srv.ts +++ b/public/app/core/services/dynamic_directive_srv.ts @@ -40,9 +40,9 @@ class DynamicDirectiveSrv { restrict: 'E', scope: options.scope, link: (scope, elem, attrs) => { - if (options.watch) { + if (options.watchPath) { let childScope = null; - scope.$watch(options.watch, () => { + scope.$watch(options.watchPath, () => { if (childScope) { childScope.$destroy(); } diff --git a/public/app/features/annotations/query_editor.ts b/public/app/features/annotations/query_editor.ts index 387f17e1454..4cc6416093a 100644 --- a/public/app/features/annotations/query_editor.ts +++ b/public/app/features/annotations/query_editor.ts @@ -9,7 +9,7 @@ function annotationsQueryEditor(dynamicDirectiveSrv) { annotation: "=", datasource: "=" }, - watch: "datasource.type", + watchPath: "datasource.type", directive: scope => { return System.import(scope.datasource.meta.module).then(function(dsModule) { return { diff --git a/public/app/features/datasources/config_view.ts b/public/app/features/datasources/config_view.ts index 8be06bbcdfd..39f593ba508 100644 --- a/public/app/features/datasources/config_view.ts +++ b/public/app/features/datasources/config_view.ts @@ -9,7 +9,7 @@ function dsConfigView(dynamicDirectiveSrv) { dsMeta: "=", current: "=" }, - watch: "dsMeta.module", + watchPath: "dsMeta.module", directive: scope => { return System.import(scope.dsMeta.module).then(function(dsModule) { return { diff --git a/public/app/features/panel/query_editor.ts b/public/app/features/panel/query_editor.ts index b360ad2aa79..01beceaee99 100644 --- a/public/app/features/panel/query_editor.ts +++ b/public/app/features/panel/query_editor.ts @@ -5,7 +5,7 @@ import angular from 'angular'; /** @ngInject */ function metricsQueryEditor(dynamicDirectiveSrv, datasourceSrv) { return dynamicDirectiveSrv.create({ - watch: "panel.datasource", + watchPath: "panel.datasource", directive: scope => { let datasource = scope.target.datasource || scope.panel.datasource; return datasourceSrv.get(datasource).then(ds => { @@ -29,7 +29,7 @@ function metricsQueryEditor(dynamicDirectiveSrv, datasourceSrv) { /** @ngInject */ function metricsQueryOptions(dynamicDirectiveSrv, datasourceSrv) { return dynamicDirectiveSrv.create({ - watch: "panel.datasource", + watchPath: "panel.datasource", directive: scope => { return datasourceSrv.get(scope.panel.datasource).then(ds => { return System.import(ds.meta.module).then(dsModule => {