fix(influxdb): rename organizationID to orgID in json struct tags

Note. This may require that users blow away thier existing boltdb
databases to avoid errors.
pull/11049/head
Michael Desa 2019-01-14 13:53:17 -05:00 committed by Deniz Kusefoglu
parent 263b3e228d
commit 7c1372cdfc
9 changed files with 21 additions and 21 deletions

View File

@ -20,7 +20,7 @@ const InfiniteRetention = 0
// Bucket is a bucket. 🎉 // Bucket is a bucket. 🎉
type Bucket struct { type Bucket struct {
ID ID `json:"id,omitempty"` ID ID `json:"id,omitempty"`
OrganizationID ID `json:"organizationID,omitempty"` OrganizationID ID `json:"orgID,omitempty"`
Organization string `json:"organization,omitempty"` Organization string `json:"organization,omitempty"`
Name string `json:"name"` Name string `json:"name"`
RetentionPolicyName string `json:"rp,omitempty"` // This to support v1 sources RetentionPolicyName string `json:"rp,omitempty"` // This to support v1 sources

View File

@ -69,7 +69,7 @@ type DashboardService interface {
// Dashboard represents all visual and query data for a dashboard. // Dashboard represents all visual and query data for a dashboard.
type Dashboard struct { type Dashboard struct {
ID ID `json:"id,omitempty"` ID ID `json:"id,omitempty"`
OrganizationID ID `json:"organizationID,omitempty"` OrganizationID ID `json:"orgID,omitempty"`
Name string `json:"name"` Name string `json:"name"`
Description string `json:"description"` Description string `json:"description"`
Cells []*Cell `json:"cells"` Cells []*Cell `json:"cells"`

View File

@ -102,7 +102,7 @@ func TestService_handleGetDashboards(t *testing.T) {
"dashboards": [ "dashboards": [
{ {
"id": "da7aba5e5d81e550", "id": "da7aba5e5d81e550",
"organizationID": "0000000000000001", "orgID": "0000000000000001",
"name": "hello", "name": "hello",
"description": "oh hello there!", "description": "oh hello there!",
"labels": [ "labels": [
@ -143,7 +143,7 @@ func TestService_handleGetDashboards(t *testing.T) {
}, },
{ {
"id": "0ca2204eca2204e0", "id": "0ca2204eca2204e0",
"organizationID": "0000000000000001", "orgID": "0000000000000001",
"name": "example", "name": "example",
"description": "", "description": "",
"labels": [ "labels": [
@ -301,7 +301,7 @@ func TestService_handleGetDashboard(t *testing.T) {
body: ` body: `
{ {
"id": "020f755c3c082000", "id": "020f755c3c082000",
"organizationID": "0000000000000001", "orgID": "0000000000000001",
"name": "hello", "name": "hello",
"description": "", "description": "",
"labels": [], "labels": [],
@ -453,7 +453,7 @@ func TestService_handlePostDashboard(t *testing.T) {
body: ` body: `
{ {
"id": "020f755c3c082000", "id": "020f755c3c082000",
"organizationID": "0000000000000001", "orgID": "0000000000000001",
"name": "hello", "name": "hello",
"description": "howdy there", "description": "howdy there",
"labels": [], "labels": [],
@ -691,7 +691,7 @@ func TestService_handlePatchDashboard(t *testing.T) {
body: ` body: `
{ {
"id": "020f755c3c082000", "id": "020f755c3c082000",
"organizationID": "0000000000000001", "orgID": "0000000000000001",
"name": "example", "name": "example",
"description": "", "description": "",
"labels": [], "labels": [],

View File

@ -121,7 +121,7 @@ func (h *ProtoHandler) handleGetProtos(w http.ResponseWriter, r *http.Request) {
type createProtoResourcesRequest struct { type createProtoResourcesRequest struct {
ProtoID platform.ID `json:"-"` ProtoID platform.ID `json:"-"`
OrganizationID platform.ID `json:"organizationID"` OrganizationID platform.ID `json:"orgID"`
} }
// Decode turns an http request into a createProtoResourceRequest. // Decode turns an http request into a createProtoResourceRequest.

View File

@ -154,7 +154,7 @@ func TestProtoHandler(t *testing.T) {
], ],
"description": "oh hello there!", "description": "oh hello there!",
"id": "da7aba5e5d81e550", "id": "da7aba5e5d81e550",
"organizationID": "0000000000000001", "orgID": "0000000000000001",
"labels": [ "labels": [
], ],
"links": { "links": {
@ -177,7 +177,7 @@ func TestProtoHandler(t *testing.T) {
], ],
"description": "", "description": "",
"id": "0ca2204eca2204e0", "id": "0ca2204eca2204e0",
"organizationID": "0000000000000001", "orgID": "0000000000000001",
"labels": [ "labels": [
], ],
"links": { "links": {

View File

@ -4946,7 +4946,7 @@ components:
type: string type: string
name: name:
type: string type: string
organizationID: orgID:
type: string type: string
organization: organization:
type: string type: string
@ -5161,7 +5161,7 @@ components:
id: id:
readOnly: true readOnly: true
type: string type: string
organizationID: orgID:
description: The ID of the organization that owns this Task. description: The ID of the organization that owns this Task.
type: string type: string
name: name:
@ -6152,7 +6152,7 @@ components:
type: string type: string
CreateProtoResourcesRequest: CreateProtoResourcesRequest:
properties: properties:
organizationID: orgID:
type: string type: string
Proto: Proto:
properties: properties:
@ -6196,7 +6196,7 @@ components:
id: id:
readOnly: true readOnly: true
type: string type: string
organizationID: orgID:
type: string type: string
description: id of the organization that owns the dashboard description: id of the organization that owns the dashboard
name: name:
@ -6237,7 +6237,7 @@ components:
type: string type: string
id: id:
type: string type: string
organizationID: orgID:
type: string type: string
default: default:
type: boolean type: boolean

View File

@ -100,7 +100,7 @@ func TestTaskHandler_handleGetTasks(t *testing.T) {
} }
} }
], ],
"organizationID": "0000000000000001", "orgID": "0000000000000001",
"status": "", "status": "",
"flux": "", "flux": "",
"owner": { "owner": {
@ -128,7 +128,7 @@ func TestTaskHandler_handleGetTasks(t *testing.T) {
} }
} }
], ],
"organizationID": "0000000000000002", "orgID": "0000000000000002",
"status": "", "status": "",
"flux": "", "flux": "",
"owner": { "owner": {
@ -224,7 +224,7 @@ func TestTaskHandler_handlePostTasks(t *testing.T) {
"id": "0000000000000001", "id": "0000000000000001",
"name": "task1", "name": "task1",
"labels": [], "labels": [],
"organizationID": "0000000000000001", "orgID": "0000000000000001",
"status": "", "status": "",
"flux": "", "flux": "",
"owner": { "owner": {

View File

@ -24,7 +24,7 @@ const (
// TODO(desa): do sources belong // TODO(desa): do sources belong
type Source struct { type Source struct {
ID ID `json:"id,string,omitempty"` // ID is the unique ID of the source ID ID `json:"id,string,omitempty"` // ID is the unique ID of the source
OrganizationID ID `json:"organizationID"` // OrganizationID is the organization ID that resource belongs to OrganizationID ID `json:"orgID"` // OrganizationID is the organization ID that resource belongs to
Default bool `json:"default"` // Default specifies the default source for the application Default bool `json:"default"` // Default specifies the default source for the application
Name string `json:"name"` // Name is the user-defined name for the source Name string `json:"name"` // Name is the user-defined name for the source
Type SourceType `json:"type,omitempty"` // Type specifies which kinds of source (enterprise vs oss vs 2.0) Type SourceType `json:"type,omitempty"` // Type specifies which kinds of source (enterprise vs oss vs 2.0)

View File

@ -22,7 +22,7 @@ const (
// Task is a task. 🎊 // Task is a task. 🎊
type Task struct { type Task struct {
ID ID `json:"id,omitempty"` ID ID `json:"id,omitempty"`
Organization ID `json:"organizationID"` Organization ID `json:"orgID"`
Name string `json:"name"` Name string `json:"name"`
Status string `json:"status"` Status string `json:"status"`
Owner User `json:"owner"` Owner User `json:"owner"`