mirror of
https://github.com/grafana/grafana.git
synced 2025-07-29 00:25:30 +08:00
Swagger: Rename Spec
to Preferences
(#78226)
The definition for preferences is globally named `Spec` because that's the type that cue outputs This adds a swagger annotation to rename the definition in the swagger schema to `Preferences` This will be easier to use in generated clients
This commit is contained in:
@ -21,7 +21,7 @@ The user or team frontend preferences
|
|||||||
| Property | Type | Required | Default | Description |
|
| Property | Type | Required | Default | Description |
|
||||||
|------------|---------------------|----------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|------------|---------------------|----------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| `metadata` | [object](#metadata) | **Yes** | | metadata contains embedded CommonMetadata and can be extended with custom string fields<br/>TODO: use CommonMetadata instead of redefining here; currently needs to be defined here<br/>without external reference as using the CommonMetadata reference breaks thema codegen. |
|
| `metadata` | [object](#metadata) | **Yes** | | metadata contains embedded CommonMetadata and can be extended with custom string fields<br/>TODO: use CommonMetadata instead of redefining here; currently needs to be defined here<br/>without external reference as using the CommonMetadata reference breaks thema codegen. |
|
||||||
| `spec` | [object](#spec) | **Yes** | | |
|
| `spec` | [object](#spec) | **Yes** | | Spec defines user, team or org Grafana preferences<br/>swagger:model Preferences |
|
||||||
| `status` | [object](#status) | **Yes** | | |
|
| `status` | [object](#status) | **Yes** | | |
|
||||||
|
|
||||||
### Metadata
|
### Metadata
|
||||||
@ -69,6 +69,9 @@ extraFields is reserved for any fields that are pulled from the API server metad
|
|||||||
|
|
||||||
### Spec
|
### Spec
|
||||||
|
|
||||||
|
Spec defines user, team or org Grafana preferences
|
||||||
|
swagger:model Preferences
|
||||||
|
|
||||||
| Property | Type | Required | Default | Description |
|
| Property | Type | Required | Default | Description |
|
||||||
|---------------------|---------------------------------------------------|----------|---------|---------------------------------------------------------------------------------|
|
|---------------------|---------------------------------------------------|----------|---------|---------------------------------------------------------------------------------|
|
||||||
| `cookiePreferences` | [CookiePreferences](#cookiepreferences) | No | | |
|
| `cookiePreferences` | [CookiePreferences](#cookiepreferences) | No | | |
|
||||||
|
@ -8,6 +8,8 @@ description: "The user or team frontend preferences"
|
|||||||
lineage: schemas: [{
|
lineage: schemas: [{
|
||||||
version: [0, 0]
|
version: [0, 0]
|
||||||
schema: {
|
schema: {
|
||||||
|
// Spec defines user, team or org Grafana preferences
|
||||||
|
// swagger:model Preferences
|
||||||
spec: {
|
spec: {
|
||||||
// UID for the home dashboard
|
// UID for the home dashboard
|
||||||
homeDashboardUID?: string
|
homeDashboardUID?: string
|
||||||
|
@ -21,6 +21,10 @@ export interface CookiePreferences {
|
|||||||
performance?: Record<string, unknown>;
|
performance?: Record<string, unknown>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Spec defines user, team or org Grafana preferences
|
||||||
|
* swagger:model Preferences
|
||||||
|
*/
|
||||||
export interface Preferences {
|
export interface Preferences {
|
||||||
/**
|
/**
|
||||||
* Cookie preferences
|
* Cookie preferences
|
||||||
|
@ -22,7 +22,8 @@ type QueryHistoryPreference struct {
|
|||||||
HomeTab *string `json:"homeTab,omitempty"`
|
HomeTab *string `json:"homeTab,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Spec defines model for Spec.
|
// Spec defines user, team or org Grafana preferences
|
||||||
|
// swagger:model Preferences
|
||||||
type Spec struct {
|
type Spec struct {
|
||||||
CookiePreferences *CookiePreferences `json:"cookiePreferences,omitempty"`
|
CookiePreferences *CookiePreferences `json:"cookiePreferences,omitempty"`
|
||||||
|
|
||||||
|
@ -5592,6 +5592,38 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Preferences": {
|
||||||
|
"description": "Spec defines user, team or org Grafana preferences",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"cookiePreferences": {
|
||||||
|
"$ref": "#/definitions/CookiePreferences"
|
||||||
|
},
|
||||||
|
"homeDashboardUID": {
|
||||||
|
"description": "UID for the home dashboard",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"language": {
|
||||||
|
"description": "Selected language (beta)",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"queryHistory": {
|
||||||
|
"$ref": "#/definitions/QueryHistoryPreference"
|
||||||
|
},
|
||||||
|
"theme": {
|
||||||
|
"description": "Theme light, dark, empty is default",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"timezone": {
|
||||||
|
"description": "The timezone selection\nTODO: this should use the timezone defined in common",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"weekStart": {
|
||||||
|
"description": "WeekStart day of the week (sunday, monday, etc)",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"PrometheusRemoteWriteTargetJSON": {
|
"PrometheusRemoteWriteTargetJSON": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@ -5777,8 +5809,10 @@
|
|||||||
},
|
},
|
||||||
"QueryHistoryPreference": {
|
"QueryHistoryPreference": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
"title": "QueryHistoryPreference defines model for QueryHistoryPreference.",
|
||||||
"properties": {
|
"properties": {
|
||||||
"homeTab": {
|
"homeTab": {
|
||||||
|
"description": "HomeTab one of: '' | 'query' | 'starred';",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6670,38 +6704,6 @@
|
|||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "int64"
|
"format": "int64"
|
||||||
},
|
},
|
||||||
"Spec": {
|
|
||||||
"type": "object",
|
|
||||||
"title": "Spec defines model for Spec.",
|
|
||||||
"properties": {
|
|
||||||
"cookiePreferences": {
|
|
||||||
"$ref": "#/definitions/CookiePreferences"
|
|
||||||
},
|
|
||||||
"homeDashboardUID": {
|
|
||||||
"description": "UID for the home dashboard",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"language": {
|
|
||||||
"description": "Selected language (beta)",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"queryHistory": {
|
|
||||||
"$ref": "#/definitions/QueryHistoryPreference"
|
|
||||||
},
|
|
||||||
"theme": {
|
|
||||||
"description": "Theme light, dark, empty is default",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"timezone": {
|
|
||||||
"description": "The timezone selection\nTODO: this should use the timezone defined in common",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"weekStart": {
|
|
||||||
"description": "WeekStart day of the week (sunday, monday, etc)",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"State": {
|
"State": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
@ -8574,7 +8576,7 @@
|
|||||||
"getPreferencesResponse": {
|
"getPreferencesResponse": {
|
||||||
"description": "",
|
"description": "",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/Spec"
|
"$ref": "#/definitions/Preferences"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"getPublicAnnotationsResponse": {
|
"getPublicAnnotationsResponse": {
|
||||||
|
@ -16832,6 +16832,38 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Preferences": {
|
||||||
|
"description": "Spec defines user, team or org Grafana preferences",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"cookiePreferences": {
|
||||||
|
"$ref": "#/definitions/CookiePreferences"
|
||||||
|
},
|
||||||
|
"homeDashboardUID": {
|
||||||
|
"description": "UID for the home dashboard",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"language": {
|
||||||
|
"description": "Selected language (beta)",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"queryHistory": {
|
||||||
|
"$ref": "#/definitions/QueryHistoryPreference"
|
||||||
|
},
|
||||||
|
"theme": {
|
||||||
|
"description": "Theme light, dark, empty is default",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"timezone": {
|
||||||
|
"description": "The timezone selection\nTODO: this should use the timezone defined in common",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"weekStart": {
|
||||||
|
"description": "WeekStart day of the week (sunday, monday, etc)",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"PrometheusRemoteWriteTargetJSON": {
|
"PrometheusRemoteWriteTargetJSON": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@ -17251,8 +17283,10 @@
|
|||||||
},
|
},
|
||||||
"QueryHistoryPreference": {
|
"QueryHistoryPreference": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
"title": "QueryHistoryPreference defines model for QueryHistoryPreference.",
|
||||||
"properties": {
|
"properties": {
|
||||||
"homeTab": {
|
"homeTab": {
|
||||||
|
"description": "HomeTab one of: '' | 'query' | 'starred';",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -18806,38 +18840,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Spec": {
|
|
||||||
"type": "object",
|
|
||||||
"title": "Spec defines model for Spec.",
|
|
||||||
"properties": {
|
|
||||||
"cookiePreferences": {
|
|
||||||
"$ref": "#/definitions/CookiePreferences"
|
|
||||||
},
|
|
||||||
"homeDashboardUID": {
|
|
||||||
"description": "UID for the home dashboard",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"language": {
|
|
||||||
"description": "Selected language (beta)",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"queryHistory": {
|
|
||||||
"$ref": "#/definitions/QueryHistoryPreference"
|
|
||||||
},
|
|
||||||
"theme": {
|
|
||||||
"description": "Theme light, dark, empty is default",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"timezone": {
|
|
||||||
"description": "The timezone selection\nTODO: this should use the timezone defined in common",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"weekStart": {
|
|
||||||
"description": "WeekStart day of the week (sunday, monday, etc)",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"State": {
|
"State": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
@ -21748,7 +21750,7 @@
|
|||||||
"getPreferencesResponse": {
|
"getPreferencesResponse": {
|
||||||
"description": "(empty)",
|
"description": "(empty)",
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/Spec"
|
"$ref": "#/definitions/Preferences"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"getPublicAnnotationsResponse": {
|
"getPublicAnnotationsResponse": {
|
||||||
|
@ -1011,7 +1011,7 @@
|
|||||||
"content": {
|
"content": {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/components/schemas/Spec"
|
"$ref": "#/components/schemas/Preferences"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -7839,6 +7839,38 @@
|
|||||||
},
|
},
|
||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
|
"Preferences": {
|
||||||
|
"description": "Spec defines user, team or org Grafana preferences",
|
||||||
|
"properties": {
|
||||||
|
"cookiePreferences": {
|
||||||
|
"$ref": "#/components/schemas/CookiePreferences"
|
||||||
|
},
|
||||||
|
"homeDashboardUID": {
|
||||||
|
"description": "UID for the home dashboard",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"language": {
|
||||||
|
"description": "Selected language (beta)",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"queryHistory": {
|
||||||
|
"$ref": "#/components/schemas/QueryHistoryPreference"
|
||||||
|
},
|
||||||
|
"theme": {
|
||||||
|
"description": "Theme light, dark, empty is default",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"timezone": {
|
||||||
|
"description": "The timezone selection\nTODO: this should use the timezone defined in common",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"weekStart": {
|
||||||
|
"description": "WeekStart day of the week (sunday, monday, etc)",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
"PrometheusRemoteWriteTargetJSON": {
|
"PrometheusRemoteWriteTargetJSON": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"data_source_uid": {
|
"data_source_uid": {
|
||||||
@ -8259,9 +8291,11 @@
|
|||||||
"QueryHistoryPreference": {
|
"QueryHistoryPreference": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"homeTab": {
|
"homeTab": {
|
||||||
|
"description": "HomeTab one of: '' | 'query' | 'starred';",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"title": "QueryHistoryPreference defines model for QueryHistoryPreference.",
|
||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
"QueryHistoryResponse": {
|
"QueryHistoryResponse": {
|
||||||
@ -9812,38 +9846,6 @@
|
|||||||
"title": "A Span defines a continuous sequence of buckets.",
|
"title": "A Span defines a continuous sequence of buckets.",
|
||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
"Spec": {
|
|
||||||
"properties": {
|
|
||||||
"cookiePreferences": {
|
|
||||||
"$ref": "#/components/schemas/CookiePreferences"
|
|
||||||
},
|
|
||||||
"homeDashboardUID": {
|
|
||||||
"description": "UID for the home dashboard",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"language": {
|
|
||||||
"description": "Selected language (beta)",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"queryHistory": {
|
|
||||||
"$ref": "#/components/schemas/QueryHistoryPreference"
|
|
||||||
},
|
|
||||||
"theme": {
|
|
||||||
"description": "Theme light, dark, empty is default",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"timezone": {
|
|
||||||
"description": "The timezone selection\nTODO: this should use the timezone defined in common",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"weekStart": {
|
|
||||||
"description": "WeekStart day of the week (sunday, monday, etc)",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"title": "Spec defines model for Spec.",
|
|
||||||
"type": "object"
|
|
||||||
},
|
|
||||||
"State": {
|
"State": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user