API: Make Swagger specification more consistent (#50576)

* Fix swagger generation targer using mac

Validate using the swagger binarry instead of the docker container

* API: Make swagger specification more consistent

Fix operation parameter ordering
This commit is contained in:
Sofia Papagiannaki 2022-06-14 13:35:22 +03:00 committed by GitHub
parent f87927c82e
commit 7418a80264
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 1674 additions and 399 deletions

View File

@ -68,7 +68,7 @@ ensure_go-swagger_mac:
-x "github.com/prometheus/alertmanager" \ -x "github.com/prometheus/alertmanager" \
-i pkg/api/docs/tags.json -i pkg/api/docs/tags.json
swagger-api-spec-mac: gen-go --swagger-api-spec-mac $(MERGED_SPEC_TARGET) validate-api-spec swagger-api-spec-mac: gen-go --swagger-api-spec-mac $(MERGED_SPEC_TARGET) validate-api-spec-mac
validate-api-spec: $(MERGED_SPEC_TARGET) ## Validate API spec validate-api-spec: $(MERGED_SPEC_TARGET) ## Validate API spec
docker run --rm -it \ docker run --rm -it \
@ -79,6 +79,9 @@ validate-api-spec: $(MERGED_SPEC_TARGET) ## Validate API spec
-w $$(pwd)/pkg/api/docs quay.io/goswagger/swagger:$(SWAGGER_TAG) \ -w $$(pwd)/pkg/api/docs quay.io/goswagger/swagger:$(SWAGGER_TAG) \
validate /grafana/$(<) validate /grafana/$(<)
validate-api-spec-mac: $(MERGED_SPEC_TARGET) ## Validate API spec
swagger validate $(<)
clean-api-spec: clean-api-spec:
rm $(SPEC_TARGET) $(MERGED_SPEC_TARGET) rm $(SPEC_TARGET) $(MERGED_SPEC_TARGET)

View File

@ -45,7 +45,7 @@ import (
// 500: internalServerError // 500: internalServerError
// swagger:parameters pauseAllAlerts // swagger:parameters pauseAllAlerts
type PauseAllAlertsParam struct { type PauseAllAlertsParams struct {
// in:body // in:body
// required:true // required:true
Body dtos.PauseAllAlertsCommand `json:"body"` Body dtos.PauseAllAlertsCommand `json:"body"`

View File

@ -61,8 +61,15 @@ package definitions
// 500: internalServerError // 500: internalServerError
// swagger:parameters getLDAPUser // swagger:parameters getLDAPUser
type UserNameParam struct { type GetLDAPUserParams struct {
// in:path // in:path
// required:true // required:true
UserID string `json:"user_name"` UserName string `json:"user_name"`
}
// swagger:parameters syncLDAPUser
type SyncLDAPUserParams struct {
// in:path
// required:true
UserID int64 `json:"user_id"`
} }

View File

@ -183,17 +183,75 @@ import (
// 500: internalServerError // 500: internalServerError
// swagger:parameters setPassword // swagger:parameters setPassword
type SetPasswordParam struct { type SetPasswordParams struct {
// in:body // in:body
// required:true // required:true
Body dtos.AdminUpdateUserPasswordForm `json:"body"` Body dtos.AdminUpdateUserPasswordForm `json:"body"`
// in:path
// required:true
UserID int64 `json:"user_id"`
} }
// swagger:parameters revokeAuthToken revokeSignedINAuthTokenCmd // swagger:parameters deleteUser
type RevokeAuthTokenParam struct { type DeleteUserParams struct {
// in:path
// required:true
UserID int64 `json:"user_id"`
}
// swagger:parameters enableUser
type EnableUserParams struct {
// in:path
// required:true
UserID int64 `json:"user_id"`
}
// swagger:parameters disableUser
type DisableUserParams struct {
// in:path
// required:true
UserID int64 `json:"user_id"`
}
// swagger:parameters getUserQuota
type GetUserQuotaParams struct {
// in:path
// required:true
UserID int64 `json:"user_id"`
}
// swagger:parameters updateUserQuota
type UpdateUserQuotaParams struct {
// in:path
// required:true
QuotaTarget string `json:"quota_target"`
// in:path
// required:true
UserID int64 `json:"user_id"`
}
// swagger:parameters getAuthTokens
type GetAuthTokensParams struct {
// in:path
// required:true
UserID int64 `json:"user_id"`
}
// swagger:parameters logoutUser
type LogoutUserParams struct {
// in:path
// required:true
UserID int64 `json:"user_id"`
}
// swagger:parameters revokeAuthToken
type RevokeAuthTokenParams struct {
// in:body // in:body
// required:true // required:true
Body models.RevokeAuthTokenCmd `json:"body"` Body models.RevokeAuthTokenCmd `json:"body"`
// in:path
// required:true
UserID int64 `json:"user_id"`
} }
// swagger:parameters createUser // swagger:parameters createUser
@ -203,13 +261,6 @@ type CreateUserParam struct {
Body dtos.AdminCreateUserForm `json:"body"` Body dtos.AdminCreateUserForm `json:"body"`
} }
// swagger:parameters updateUserQuota updateOrgQuota
type TargeQuotaParam struct {
// in:path
// required:true
QuotaTarget string `json:"quota_target"`
}
// swagger:parameters updateUserQuota // swagger:parameters updateUserQuota
type UpdateUserQuotaParam struct { type UpdateUserQuotaParam struct {
// in:body // in:body
@ -218,10 +269,13 @@ type UpdateUserQuotaParam struct {
} }
// swagger:parameters setPermissions // swagger:parameters setPermissions
type SetPermissionsParam struct { type SetPermissionsParams struct {
// in:body // in:body
// required:true // required:true
Body dtos.AdminUpdateUserPermissionsForm `json:"body"` Body dtos.AdminUpdateUserPermissionsForm `json:"body"`
// in:path
// required:true
UserID int64 `json:"user_id"`
} }
// swagger:response createUserResponse // swagger:response createUserResponse

View File

@ -113,8 +113,15 @@ import (
// 401: unauthorisedError // 401: unauthorisedError
// 500: internalServerError // 500: internalServerError
// swagger:parameters getAnnotation updateAnnotation patchAnnotation deleteAnnotation // swagger:parameters getAnnotation
type AnnotationIDParam struct { type GetAnnotationParams struct {
// in:path
// required:true
AnnotationID string `json:"annotation_id"`
}
// swagger:parameters deleteAnnotation
type DeleteAnnotationParams struct {
// in:path // in:path
// required:true // required:true
AnnotationID string `json:"annotation_id"` AnnotationID string `json:"annotation_id"`
@ -206,6 +213,9 @@ type CreateGraphiteAnnotationParams struct {
// swagger:parameters updateAnnotation // swagger:parameters updateAnnotation
type UpdateAnnotationParams struct { type UpdateAnnotationParams struct {
// in:path
// required:true
AnnotationID string `json:"annotation_id"`
// in:body // in:body
// required:true // required:true
Body dtos.UpdateAnnotationsCmd `json:"body"` Body dtos.UpdateAnnotationsCmd `json:"body"`
@ -213,6 +223,9 @@ type UpdateAnnotationParams struct {
// swagger:parameters patchAnnotation // swagger:parameters patchAnnotation
type PatchAnnotationParams struct { type PatchAnnotationParams struct {
// in:path
// required:true
AnnotationID string `json:"annotation_id"`
// in:body // in:body
// required:true // required:true
Body dtos.PatchAnnotationsCmd `json:"body"` Body dtos.PatchAnnotationsCmd `json:"body"`

View File

@ -101,7 +101,21 @@ import (
// 422: unprocessableEntityError // 422: unprocessableEntityError
// 500: internalServerError // 500: internalServerError
// swagger:parameters getDashboardByUID deleteDashboardByUID getDashboardPermissionsWithUid postDashboardPermissionsWithUid getDashboardVersionByUID // swagger:parameters getDashboardByUID
type GetDashboardByUIDParams struct {
// in:path
// required:true
UID string `json:"uid"`
}
// swagger:parameters deleteDashboardByUID
type DeleteDashboardByUIDParams struct {
// in:path
// required:true
UID string `json:"uid"`
}
// swagger:parameters getDashboardPermissionsWithUid postDashboardPermissionsWithUid getDashboardVersionByUID
// swagger:parameters getDashboardVersionsByUID restoreDashboardVersionByUID // swagger:parameters getDashboardVersionsByUID restoreDashboardVersionByUID
type UID struct { type UID struct {
// in:path // in:path

View File

@ -63,11 +63,30 @@ import (
// 404: notFoundError // 404: notFoundError
// 500: internalServerError // 500: internalServerError
// swagger:parameters postDashboardPermissions updateFolderPermissions postDashboardPermissionsWithUid // swagger:parameters getDashboardPermissions
type PostDashboardPermissionsParam struct { type GetDashboardPermissionsParams struct {
// in:path
DashboardID int64
}
// swagger:parameters postDashboardPermissions
type PostDashboardPermissionsParams struct {
// in:body // in:body
// required:true // required:true
Body dtos.UpdateDashboardAclCommand Body dtos.UpdateDashboardAclCommand
// in:path
DashboardID int64
}
// swagger:parameters postDashboardPermissionsWithUid
type PostDashboardPermissionsWithUIDParams struct {
// in:body
// required:true
Body dtos.UpdateDashboardAclCommand
// in:path
// required:true
// description: The dashboard UID
UID string `json:"uid"`
} }
// swagger:response getDashboardPermissionsResponse // swagger:response getDashboardPermissionsResponse

View File

@ -84,7 +84,7 @@ import (
// 500: internalServerError // 500: internalServerError
// swagger:parameters getDashboardVersions getDashboardVersion restoreDashboardVersion // swagger:parameters getDashboardVersions getDashboardVersion restoreDashboardVersion
// swagger:parameters getDashboardPermissions postDashboardPermissions // swagger:parameters getDashboardPermissions
// swagger:parameters renderReportPDF // swagger:parameters renderReportPDF
type DashboardIdParam struct { type DashboardIdParam struct {
// in:path // in:path

View File

@ -333,7 +333,7 @@ import (
// 404: notFoundError // 404: notFoundError
// 500: internalServerError // 500: internalServerError
// swagger:parameters updateDatasourceByID deleteDatasourceByID getDatasourceByID datasourceProxyGETcalls datasourceProxyPOSTcalls datasourceProxyDELETEcalls // swagger:parameters updateDatasourceByID datasourceProxyDELETEcalls
// swagger:parameters checkDatasourceHealthByID fetchDatasourceResourcesByID // swagger:parameters checkDatasourceHealthByID fetchDatasourceResourcesByID
type DatasourceID struct { type DatasourceID struct {
// in:path // in:path
@ -341,7 +341,31 @@ type DatasourceID struct {
DatasourceID string `json:"id"` DatasourceID string `json:"id"`
} }
// swagger:parameters updateDatasourceByUID deleteDatasourceByUID getDatasourceByUID datasourceProxyGETByUIDcalls datasourceProxyPOSTByUIDcalls datasourceProxyDELETEByUIDcalls // swagger:parameters deleteDatasourceByID
type DeleteDatasourceByIDParams struct {
// in:path
// required:true
DatasourceID string `json:"id"`
}
// swagger:parameters getDatasourceByID
type GetDatasourceByIDParams struct {
// in:path
// required:true
DatasourceID string `json:"id"`
}
// swagger:parameters datasourceProxyGETcalls
type DatasourceProxyGETcallsParams struct {
// in:path
// required:true
DatasourceProxyRoute string `json:"datasource_proxy_route"`
// in:path
// required:true
DatasourceID string `json:"id"`
}
// swagger:parameters datasourceProxyDELETEByUIDcalls
// swagger:parameters checkDatasourceHealth fetchDatasourceResources // swagger:parameters checkDatasourceHealth fetchDatasourceResources
type DatasourceUID struct { type DatasourceUID struct {
// in:path // in:path
@ -349,15 +373,53 @@ type DatasourceUID struct {
DatasourceUID string `json:"uid"` DatasourceUID string `json:"uid"`
} }
// swagger:parameters getDatasourceByName deleteDatasourceByName getDatasourceIdByName // swagger:parameters deleteDatasourceByUID
type DatasourceName struct { type DeleteDatasourceByUIDParams struct {
// in:path
// required:true
DatasourceUID string `json:"uid"`
}
// swagger:parameters getDatasourceByUID
type GetDatasourceByUIDParams struct {
// in:path
// required:true
DatasourceUID string `json:"uid"`
}
// swagger:parameters datasourceProxyGETByUIDcalls
type DatasourceProxyGETByUIDcallsParams struct {
// in:path
// required:true
DatasourceProxyRoute string `json:"datasource_proxy_route"`
// in:path
// required:true
DatasourceUID string `json:"uid"`
}
// swagger:parameters getDatasourceByName
type GetDatasourceByNameParams struct {
// in:path // in:path
// required:true // required:true
DatasourceName string `json:"name"` DatasourceName string `json:"name"`
} }
// swagger:parameters datasourceProxyGETcalls datasourceProxyPOSTcalls datasourceProxyDELETEcalls datasourceProxyGETByUIDcalls // swagger:parameters deleteDatasourceByName
// swagger:parameters datasourceProxyPOSTByUIDcalls datasourceProxyDELETEByUIDcalls type DeleteDatasourceByNameParams struct {
// in:path
// required:true
DatasourceName string `json:"name"`
}
// swagger:parameters getDatasourceIdByName
type GetDatasourceIdByNameParams struct {
// in:path
// required:true
DatasourceName string `json:"name"`
}
// swagger:parameters datasourceProxyDELETEcalls
// swagger:parameters datasourceProxyDELETEByUIDcalls
// swagger:parameters fetchDatasourceResources fetchDatasourceResourcesByID // swagger:parameters fetchDatasourceResources fetchDatasourceResourcesByID
type DatasourceProxyRouteParam struct { type DatasourceProxyRouteParam struct {
// in:path // in:path
@ -366,24 +428,56 @@ type DatasourceProxyRouteParam struct {
} }
// swagger:parameters datasourceProxyPOSTcalls // swagger:parameters datasourceProxyPOSTcalls
type DatasourceProxyParam struct { type DatasourceProxyPOSTcallsParams struct {
// in:body // in:body
// required:true // required:true
DatasourceProxyParam interface{} DatasourceProxyParam interface{}
// in:path
// required:true
DatasourceProxyRoute string `json:"datasource_proxy_route"`
// in:path
// required:true
DatasourceID string `json:"id"`
}
// swagger:parameters datasourceProxyPOSTByUIDcalls
type DatasourceProxyPOSTByUIDcallsParams struct {
// in:body
// required:true
DatasourceProxyParam interface{}
// in:path
// required:true
DatasourceProxyRoute string `json:"datasource_proxy_route"`
// in:path
// required:true
DatasourceUID string `json:"uid"`
} }
// swagger:parameters addDatasource // swagger:parameters addDatasource
type AddDatasourceParam struct { type AddDatasourceParams struct {
// in:body // in:body
// required:true // required:true
Body models.AddDataSourceCommand Body models.AddDataSourceCommand
} }
// swagger:parameters updateDatasourceByID updateDatasourceByUID // swagger:parameters updateDatasourceByID
type UpdateDatasource struct { type UpdateDatasourceParams struct {
// in:body // in:body
// required:true // required:true
Body models.UpdateDataSourceCommand Body models.UpdateDataSourceCommand
// in:path
// required:true
DatasourceID string `json:"id"`
}
// swagger:parameters updateDatasourceByUID
type UpdateDatasourceByUIDParams struct {
// in:body
// required:true
Body models.UpdateDataSourceCommand
// in:path
// required:true
DatasourceUID string `json:"uid"`
} }
// swagger:response getDatasourcesResponse // swagger:response getDatasourcesResponse

View File

@ -95,13 +95,23 @@ type GetFoldersParams struct {
} }
// swagger:parameters getFolderByUID updateFolder deleteFolder // swagger:parameters getFolderByUID updateFolder deleteFolder
// swagger:parameters getFolderPermissions updateFolderPermissions // swagger:parameters getFolderPermissions
type FolderUIDParam struct { type FolderUIDParam struct {
// in:path // in:path
// required:true // required:true
FolderUID string `json:"folder_uid"` FolderUID string `json:"folder_uid"`
} }
// swagger:parameters updateFolderPermissions
type PostDashboardPermissionsParam struct {
// in:path
// required:true
FolderUID string `json:"folder_uid"`
// in:body
// required:true
Body dtos.UpdateDashboardAclCommand
}
// swagger:parameters getFolderByID // swagger:parameters getFolderByID
type FolderIDParam struct { type FolderIDParam struct {
// in:path // in:path

View File

@ -108,7 +108,7 @@ import (
// 404: notFoundError // 404: notFoundError
// 500: internalServerError // 500: internalServerError
// swagger:route PUT /alert-notifications/uid/{notification_channel_uid} legacy_alerts_notification_channels updateAlertNotificationChannelBYUID // swagger:route PUT /alert-notifications/uid/{notification_channel_uid} legacy_alerts_notification_channels updateAlertNotificationChannelByUID
// //
// Update notification channel by UID. // Update notification channel by UID.
// //
@ -134,46 +134,66 @@ import (
// 404: notFoundError // 404: notFoundError
// 500: internalServerError // 500: internalServerError
// swagger:parameters updateAlertNotificationChannel getAlertNotificationChannelByID deleteAlertNotificationChannel // swagger:parameters deleteAlertNotificationChannel
type NotificationIDParam struct { type DeleteAlertNotificationChannelParams struct {
// in:path // in:path
// required:true // required:true
NotificationID int64 `json:"notification_channel_id"` NotificationID int64 `json:"notification_channel_id"`
} }
// swagger:parameters getAlertNotificationChannelByUID updateAlertNotificationChannelBYUID deleteAlertNotificationChannelByUID // swagger:parameters getAlertNotificationChannelByID
type NotificationUIDParam struct { type GetAlertNotificationChannelByIDParams struct {
// in:path
// required:true
NotificationID int64 `json:"notification_channel_id"`
}
// swagger:parameters deleteAlertNotificationChannelByUID
type DeleteAlertNotificationChannelByUIDParams struct {
// in:path
// required:true
NotificationUID string `json:"notification_channel_uid"`
}
// swagger:parameters getAlertNotificationChannelByUID
type GetAlertNotificationChannelByUIDParams struct {
// in:path // in:path
// required:true // required:true
NotificationUID string `json:"notification_channel_uid"` NotificationUID string `json:"notification_channel_uid"`
} }
// swagger:parameters notificationChannelTest // swagger:parameters notificationChannelTest
type NotificationChannelTestParam struct { type NotificationChannelTestParams struct {
// in:body // in:body
// required:true // required:true
Body dtos.NotificationTestCommand `json:"body"` Body dtos.NotificationTestCommand `json:"body"`
} }
// swagger:parameters createAlertNotificationChannel // swagger:parameters createAlertNotificationChannel
type CreateAlertNotificationChannelParam struct { type CreateAlertNotificationChannelParams struct {
// in:body // in:body
// required:true // required:true
Body models.CreateAlertNotificationCommand `json:"body"` Body models.CreateAlertNotificationCommand `json:"body"`
} }
// swagger:parameters updateAlertNotificationChannel // swagger:parameters updateAlertNotificationChannel
type UpdateAlertNotificationChannelParam struct { type UpdateAlertNotificationChannelParams struct {
// in:body // in:body
// required:true // required:true
Body models.UpdateAlertNotificationCommand `json:"body"` Body models.UpdateAlertNotificationCommand `json:"body"`
// in:path
// required:true
NotificationID int64 `json:"notification_channel_id"`
} }
// swagger:parameters updateAlertNotificationChannelBYUID // swagger:parameters updateAlertNotificationChannelByUID
type UpdateAlertNotificationChannelBYUIDParam struct { type UpdateAlertNotificationChannelBYUIDParams struct {
// in:body // in:body
// required:true // required:true
Body models.UpdateAlertNotificationWithUidCommand `json:"body"` Body models.UpdateAlertNotificationWithUidCommand `json:"body"`
// in:path
// required:true
NotificationUID string `json:"notification_channel_uid"`
} }
// swagger:response getAlertNotificationChannelsResponse // swagger:response getAlertNotificationChannelsResponse

View File

@ -58,15 +58,18 @@ import (
// 400: badRequestError // 400: badRequestError
// 500: internalServerError // 500: internalServerError
// swagger:parameters getAlertByID pauseAlert // swagger:parameters getAlertByID
type AlertIDParam struct { type GetAlertByIDParams struct {
// in:path // in:path
// required:true // required:true
AlertID string `json:"alert_id"` AlertID string `json:"alert_id"`
} }
// swagger:parameters pauseAlert // swagger:parameters pauseAlert
type PauseAlertParam struct { type PauseAlertParams struct {
// in:path
// required:true
AlertID string `json:"alert_id"`
// in:body // in:body
// required:true // required:true
Body dtos.PauseAlertCommand `json:"body"` Body dtos.PauseAlertCommand `json:"body"`
@ -122,13 +125,13 @@ type GetAlertsParams struct {
} }
// swagger:parameters testAlert // swagger:parameters testAlert
type TestAlertParam struct { type TestAlertParams struct {
// in:body // in:body
Body dtos.AlertTestCommand `json:"body"` Body dtos.AlertTestCommand `json:"body"`
} }
// swagger:parameters getDashboardStates // swagger:parameters getDashboardStates
type GetDashboardStatesParam struct { type GetDashboardStatesParams struct {
// in:query // in:query
// required: true // required: true
DashboardID int64 `json:"dashboardId"` DashboardID int64 `json:"dashboardId"`

View File

@ -97,15 +97,36 @@ import (
// 404: notFoundError // 404: notFoundError
// 500: internalServerError // 500: internalServerError
// swagger:parameters getLibraryElementByUID getLibraryElementConnections updateLibraryElement deleteLibraryElementByUID // swagger:parameters getLibraryElementByUID getLibraryElementConnections
type LibraryElementByUID struct { type LibraryElementByUID struct {
// in:path // in:path
// required:true // required:true
UID string `json:"library_element_uid"` UID string `json:"library_element_uid"`
} }
// swagger:parameters getLibraryElementByUID
type GetLibraryElementByUIDParams struct {
// in:path
// required:true
UID string `json:"library_element_uid"`
}
// swagger:parameters GetLibraryElementConnectionsParams
type GetLibraryElementConnectionsParams struct {
// in:path
// required:true
UID string `json:"library_element_uid"`
}
// swagger:parameters deleteLibraryElementByUID
type DeleteLibraryElementByUIDParams struct {
// in:path
// required:true
UID string `json:"library_element_uid"`
}
// swagger:parameters getLibraryElementByName // swagger:parameters getLibraryElementByName
type LibraryElementByName struct { type LibraryElementByNameParams struct {
// in:path // in:path
// required:true // required:true
Name string `json:"library_element_name"` Name string `json:"library_element_name"`
@ -158,7 +179,7 @@ type GetLibraryElementsParams struct {
} }
// swagger:parameters createLibraryElement // swagger:parameters createLibraryElement
type CreateLibraryElementParam struct { type CreateLibraryElementParams struct {
// in:body // in:body
// required:true // required:true
Body libraryelements.CreateLibraryElementCommand `json:"body"` Body libraryelements.CreateLibraryElementCommand `json:"body"`
@ -169,6 +190,9 @@ type UpdateLibraryElementParam struct {
// in:body // in:body
// required:true // required:true
Body libraryelements.PatchLibraryElementCommand `json:"body"` Body libraryelements.PatchLibraryElementCommand `json:"body"`
// in:path
// required:true
UID string `json:"library_element_uid"`
} }
// swagger:response getLibraryElementsResponse // swagger:response getLibraryElementsResponse

View File

@ -108,29 +108,39 @@ import (
// 403: forbiddenError // 403: forbiddenError
// 500: internalServerError // 500: internalServerError
// swagger:parameters updateOrgAddress adminUpdateOrgAddress // swagger:parameters updateOrgAddress
type UpdateOrgAddressParam struct { type UpdateOrgAddressParams struct {
// in:body // in:body
// required:true // required:true
Body dtos.UpdateOrgAddressForm `json:"body"` Body dtos.UpdateOrgAddressForm `json:"body"`
} }
// swagger:parameters updateOrgUser adminUpdateOrgUser // swagger:parameters updateOrgUser
type UpdateOrgUserParam struct { type UpdateOrgUserParams struct {
// in:body // in:body
// required:true // required:true
Body models.UpdateOrgUserCommand `json:"body"` Body models.UpdateOrgUserCommand `json:"body"`
// in:path
// required:true
UserID int64 `json:"user_id"`
} }
// swagger:parameters updateOrg adminUpdateOrg // swagger:parameters deleteOrgUser
type UpdateOrgParam struct { type DeleteOrgUserParams struct {
// in:path
// required:true
UserID int64 `json:"user_id"`
}
// swagger:parameters updateOrg
type UpdateOrgParams struct {
// in:body // in:body
// required:true // required:true
Body dtos.UpdateOrgForm `json:"body"` Body dtos.UpdateOrgForm `json:"body"`
} }
// swagger:parameters addOrgUser adminAddOrgUser // swagger:parameters addOrgUser
type AddOrgUserParam struct { type AddOrgUserParams struct {
// in:body // in:body
// required:true // required:true
Body models.AddOrgUserCommand `json:"body"` Body models.AddOrgUserCommand `json:"body"`

View File

@ -39,14 +39,14 @@ import (
// 500: internalServerError // 500: internalServerError
// swagger:parameters addInvite // swagger:parameters addInvite
type AddInviteParam struct { type AddInviteParams struct {
// in:body // in:body
// required:true // required:true
Body dtos.AddInviteForm `json:"body"` Body dtos.AddInviteForm `json:"body"`
} }
// swagger:parameters revokeInvite // swagger:parameters revokeInvite
type RevokeInviteParam struct { type RevokeInviteParams struct {
// in:path // in:path
// required:true // required:true
Code string `json:"invitation_code"` Code string `json:"invitation_code"`

View File

@ -1,5 +1,7 @@
package definitions package definitions
import "github.com/grafana/grafana/pkg/api/dtos"
// swagger:route GET /org/preferences org_preferences getOrgPreferences // swagger:route GET /org/preferences org_preferences getOrgPreferences
// //
// Get Current Org Prefs. // Get Current Org Prefs.
@ -31,3 +33,10 @@ package definitions
// 401: unauthorisedError // 401: unauthorisedError
// 403: forbiddenError // 403: forbiddenError
// 500: internalServerError // 500: internalServerError
// swagger:parameters updateOrgPreferences
type UpdateOrgPreferencesParams struct {
// in:body
// required:true
Body dtos.UpdatePrefsCmd `json:"body"`
}

View File

@ -1,6 +1,9 @@
package definitions package definitions
import "github.com/grafana/grafana/pkg/models" import (
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/models"
)
// swagger:route GET /orgs/{org_id} orgs getOrgByID // swagger:route GET /orgs/{org_id} orgs getOrgByID
// //
@ -183,10 +186,82 @@ import "github.com/grafana/grafana/pkg/models"
// 404: notFoundError // 404: notFoundError
// 500: internalServerError // 500: internalServerError
// swagger:parameters getOrgByID adminUpdateOrg adminUpdateOrgAddress adminDeleteOrg adminGetOrgUsers // swagger:parameters getOrgQuota
// swagger:parameters adminAddOrgUser adminUpdateOrgUser adminDeleteOrgUser type GetOrgQuotaParams struct {
// swagger:parameters getOrgQuota updateOrgQuota userSetUsingOrg // in:path
type OrgIDParam struct { // required:true
OrgID int64 `json:"org_id"`
}
// swagger:parameters adminUpdateOrgAddress
type AdminUpdateOrgAddressParams struct {
// in:body
// required:true
Body dtos.UpdateOrgAddressForm `json:"body"`
// in:path
// required:true
OrgID int64 `json:"org_id"`
}
// swagger:parameters adminUpdateOrgUser
type AdminUpdateOrgUserParams struct {
// in:body
// required:true
Body models.UpdateOrgUserCommand `json:"body"`
// in:path
// required:true
OrgID int64 `json:"org_id"`
// in:path
// required:true
UserID int64 `json:"user_id"`
}
// swagger:parameters getOrgByID
type GetOrgByIDParams struct {
// in:path
// required:true
OrgID int64 `json:"org_id"`
}
// swagger:parameters adminDeleteOrgUser
type AdminDeleteOrgUserParams struct {
// in:path
// required:true
OrgID int64 `json:"org_id"`
// in:path
// required:true
UserID int64 `json:"user_id"`
}
// swagger:parameters adminDeleteOrg
type AdminDeleteOrgParams struct {
// in:path
// required:true
OrgID int64 `json:"org_id"`
}
// swagger:parameters adminGetOrgUsers
type AdminGetOrgUsersParams struct {
// in:path
// required:true
OrgID int64 `json:"org_id"`
}
// swagger:parameters adminUpdateOrg
type AdminUpdateOrgParams struct {
// in:body
// required:true
Body dtos.UpdateOrgForm `json:"body"`
// in:path
// required:true
OrgID int64 `json:"org_id"`
}
// swagger:parameters adminAddOrgUser
type AdminAddOrgUserParams struct {
// in:body
// required:true
Body models.AddOrgUserCommand `json:"body"`
// in:path // in:path
// required:true // required:true
OrgID int64 `json:"org_id"` OrgID int64 `json:"org_id"`
@ -206,7 +281,7 @@ type CreateOrgParam struct {
Body models.CreateOrgCommand `json:"body"` Body models.CreateOrgCommand `json:"body"`
} }
// swagger:parameters searchOrg searchTeams // swagger:parameters searchOrg
type SearchOrgParams struct { type SearchOrgParams struct {
// in:query // in:query
// required:false // required:false
@ -229,6 +304,12 @@ type UpdateOrgQuotaParam struct {
// in:body // in:body
// required:true // required:true
Body models.UpdateOrgQuotaCmd `json:"body"` Body models.UpdateOrgQuotaCmd `json:"body"`
// in:path
// required:true
QuotaTarget string `json:"quota_target"`
// in:path
// required:true
OrgID int64 `json:"org_id"`
} }
// swagger:response createOrgResponse // swagger:response createOrgResponse

View File

@ -19,7 +19,7 @@ import "github.com/grafana/grafana/pkg/models"
// 500: internalServerError // 500: internalServerError
// swagger:parameters search // swagger:parameters search
type SearchParameters struct { type SearchParams struct {
// Search Query // Search Query
// in:query // in:query
// required: false // required: false

View File

@ -65,7 +65,7 @@ import (
// 401: unauthorisedError // 401: unauthorisedError
// swagger:parameters createSnapshot // swagger:parameters createSnapshot
type CreateSnapshotParam struct { type CreateSnapshotParams struct {
// in:body // in:body
// required:true // required:true
Body models.CreateDashboardSnapshotCommand `json:"body"` Body models.CreateDashboardSnapshotCommand `json:"body"`
@ -82,14 +82,20 @@ type GetSnapshotsParams struct {
Limit int64 `json:"limit"` Limit int64 `json:"limit"`
} }
// swagger:parameters getSnapshotByKey deleteSnapshotByKey // swagger:parameters getSnapshotByKey
type SnapshotByKeyParam struct { type SnapshotByKeyParams struct {
// in:path
Key string `json:"key"`
}
// swagger:parameters deleteSnapshotByKey
type DeleteSnapshotByKeyParams struct {
// in:path // in:path
Key string `json:"key"` Key string `json:"key"`
} }
// swagger:parameters deleteSnapshotByDeleteKey // swagger:parameters deleteSnapshotByDeleteKey
type DeleteSnapshotByDeleteKeyParam struct { type DeleteSnapshotByDeleteKeyParams struct {
// in:path // in:path
DeleteKey string `json:"deleteKey"` DeleteKey string `json:"deleteKey"`
} }

View File

@ -1,6 +1,9 @@
package definitions package definitions
import "github.com/grafana/grafana/pkg/models" import (
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/models"
)
// swagger:route GET /teams/search teams searchTeams // swagger:route GET /teams/search teams searchTeams
// //
@ -120,33 +123,97 @@ import "github.com/grafana/grafana/pkg/models"
// 401: unauthorisedError // 401: unauthorisedError
// 500: internalServerError // 500: internalServerError
// swagger:parameters getTeam updateTeam deleteTeamByID getTeamMembers addTeamMember updateTeamMember // swagger:parameters updateTeamPreferences
// swagger:parameters removeTeamMember getTeamPreferences updateTeamPreferences type UpdateTeamPreferencesParams struct {
type TeamIDParam struct { // in:path
// required:true
TeamID string `json:"team_id"`
// in:body
// required:true
Body dtos.UpdatePrefsCmd `json:"body"`
}
// swagger:parameters getTeam
type GetTeamParams struct {
// in:path // in:path
// required:true // required:true
TeamID string `json:"team_id"` TeamID string `json:"team_id"`
} }
// swagger:parameters deleteTeamByID
type DeleteTeamByIDParams struct {
// in:path
// required:true
TeamID string `json:"team_id"`
}
// swagger:parameters getTeamMembers
type GetTeamMembersParams struct {
// in:path
// required:true
TeamID string `json:"team_id"`
}
// swagger:parameters getTeamPreferences
type GetTeamPreferencesParams struct {
// in:path
// required:true
TeamID string `json:"team_id"`
}
// swagger:parameters removeTeamMember
type RemoveTeamMemberParams struct {
// in:path
// required:true
TeamID string `json:"team_id"`
// in:path
// required:true
UserID int64 `json:"user_id"`
}
// swagger:parameters searchTeams
type SearchTeamsParams struct {
// in:query
// required:false
// default: 1
Page int `json:"page"`
// Number of items per page
// The totalCount field in the response can be used for pagination list E.g. if totalCount is equal to 100 teams and the perpage parameter is set to 10 then there are 10 pages of teams.
// in:query
// required:false
// default: 1000
PerPage int `json:"perpage"`
Name string `json:"name"`
// If set it will return results where the query value is contained in the name field. Query values with spaces need to be URL encoded.
// required:false
Query string `json:"query"`
}
// swagger:parameters createTeam // swagger:parameters createTeam
type CreateTeamParam struct { type CreateTeamParams struct {
// in:body // in:body
// required:true // required:true
Body models.CreateTeamCommand `json:"body"` Body models.CreateTeamCommand `json:"body"`
} }
// swagger:parameters updateTeam // swagger:parameters updateTeam
type UpdateTeamParam struct { type UpdateTeamParams struct {
// in:body // in:body
// required:true // required:true
Body models.UpdateTeamCommand `json:"body"` Body models.UpdateTeamCommand `json:"body"`
// in:path
// required:true
TeamID string `json:"team_id"`
} }
// swagger:parameters addTeamMemberTeam // swagger:parameters addTeamMember
type AddTeamMemberParam struct { type AddTeamMemberParams struct {
// in:body // in:body
// required:true // required:true
Body models.AddTeamMemberCommand `json:"body"` Body models.AddTeamMemberCommand `json:"body"`
// in:path
// required:true
TeamID string `json:"team_id"`
} }
// swagger:parameters updateTeamMember // swagger:parameters updateTeamMember
@ -154,6 +221,12 @@ type UpdateTeamMember struct {
// in:body // in:body
// required:true // required:true
Body models.UpdateTeamMemberCommand `json:"body"` Body models.UpdateTeamMemberCommand `json:"body"`
// in:path
// required:true
TeamID string `json:"team_id"`
// in:path
// required:true
UserID int64 `json:"user_id"`
} }
// swagger:response searchTeamsResponse // swagger:response searchTeamsResponse

View File

@ -148,7 +148,7 @@ import "github.com/grafana/grafana/pkg/models"
// 403: forbiddenError // 403: forbiddenError
// 500: internalServerError // 500: internalServerError
// swagger:route POST /user/revoke-auth-token signed_in_user revokeSignedINAuthTokenCmd // swagger:route POST /user/revoke-auth-token signed_in_user revokeSignedInAuthToken
// //
// Revoke an auth token of the actual User. // Revoke an auth token of the actual User.
// //
@ -161,28 +161,57 @@ import "github.com/grafana/grafana/pkg/models"
// 403: forbiddenError // 403: forbiddenError
// 500: internalServerError // 500: internalServerError
// swagger:parameters starDashboard unstarDashboard // swagger:parameters updateSignedInUser
type DashboardIDParam struct { type UpdateSignedInUserParams struct {
// To change the email, name, login, theme, provide another one.
// in:body
// required:true
Body models.UpdateUserCommand `json:"body"`
}
// swagger:parameters userSetUsingOrg
type UserSetUsingOrgParams struct {
// in:path
// required:true
OrgID int64 `json:"org_id"`
}
// swagger:parameters starDashboard
type StarDashboardParams struct {
// in:path
// required:true
DashboardID string `json:"dashboard_id"`
}
// swagger:parameters unstarDashboard
type UnstarDashboardParams struct {
// in:path // in:path
// required:true // required:true
DashboardID string `json:"dashboard_id"` DashboardID string `json:"dashboard_id"`
} }
// swagger:parameters setHelpFlag // swagger:parameters setHelpFlag
type FlagIDParam struct { type SetHelpFlagParams struct {
// in:path // in:path
// required:true // required:true
FlagID string `json:"flag_id"` FlagID string `json:"flag_id"`
} }
// swagger:parameters updateUser changeUserPassword // swagger:parameters changeUserPassword
type ChangeUserPasswordParam struct { type ChangeUserPasswordParams struct {
// To change the email, name, login, theme, provide another one. // To change the email, name, login, theme, provide another one.
// in:body // in:body
// required:true // required:true
Body models.ChangeUserPasswordCommand `json:"body"` Body models.ChangeUserPasswordCommand `json:"body"`
} }
// swagger:parameters revokeSignedInAuthToken
type RevokeSignedINAuthTokenCmdParams struct {
// in:body
// required:true
Body models.RevokeAuthTokenCmd `json:"body"`
}
// swagger:response helpFlagResponse // swagger:response helpFlagResponse
type HelpFlagResponse struct { type HelpFlagResponse struct {
// The response message // The response message

View File

@ -121,33 +121,44 @@ type SearchUsersWithPagingParams struct {
Query string `json:"query"` Query string `json:"query"`
} }
// swagger:parameters getUserByID updateUser getUserOrgList getUserTeams // swagger:parameters getUserByID
// swagger:parameters setPassword setPermissions deleteUser getAuthTokens logoutUser revokeAuthToken type GetUserByIDParams struct {
// swagger:parameters syncLDAPUser disableUser enableUser getUserQuota updateUserQuota // in:path
// swagger:parameters updateOrgUser deleteOrgUser adminUpdateOrgUser adminDeleteOrgUser // required:true
// swagger:parameters updateTeamMember removeTeamMember UserID int64 `json:"user_id"`
// swagger:parameters listUserRoles addUserRole }
// swagger:parameters listUserRoles addUserRole removeUserRole setUserRoles listUserRoles
type UserIDParam struct { // swagger:parameters getUserOrgList
type GetUserOrgListParams struct {
// in:path
// required:true
UserID int64 `json:"user_id"`
}
// swagger:parameters getUserTeams
type GetUserTeamsParams struct {
// in:path // in:path
// required:true // required:true
UserID int64 `json:"user_id"` UserID int64 `json:"user_id"`
} }
// swagger:parameters getUserByLoginOrEmail // swagger:parameters getUserByLoginOrEmail
type GetUserByLoginOrEmailParam struct { type GetUserByLoginOrEmailParams struct {
// loginOrEmail of the user // loginOrEmail of the user
// in:query // in:query
// required:true // required:true
LoginOrEmail string `json:"loginOrEmail"` LoginOrEmail string `json:"loginOrEmail"`
} }
// swagger:parameters updateUser updateSignedInUser // swagger:parameters updateUser
type UpdateUserParam struct { type UpdateUserParams struct {
// To change the email, name, login, theme, provide another one. // To change the email, name, login, theme, provide another one.
// in:body // in:body
// required:true // required:true
Body models.UpdateUserCommand `json:"body"` Body models.UpdateUserCommand `json:"body"`
// in:path
// required:true
UserID int64 `json:"user_id"`
} }
// swagger:response searchUsersResponse // swagger:response searchUsersResponse

File diff suppressed because it is too large Load Diff

View File

@ -75,12 +75,6 @@
"summary": "Remove a built-in role assignment.", "summary": "Remove a built-in role assignment.",
"operationId": "removeBuiltinRole", "operationId": "removeBuiltinRole",
"parameters": [ "parameters": [
{
"type": "string",
"name": "roleUID",
"in": "path",
"required": true
},
{ {
"type": "string", "type": "string",
"name": "builtinRole", "name": "builtinRole",
@ -92,6 +86,12 @@
"description": "A flag indicating if the assignment is global or not. If set to false, the default org ID of the authenticated user will be used from the request to remove assignment.", "description": "A flag indicating if the assignment is global or not. If set to false, the default org ID of the authenticated user will be used from the request to remove assignment.",
"name": "global", "name": "global",
"in": "query" "in": "query"
},
{
"type": "string",
"name": "roleUID",
"in": "path",
"required": true
} }
], ],
"responses": { "responses": {
@ -142,7 +142,7 @@
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"$ref": "#/definitions/SetUserRolesCommand" "$ref": "#/definitions/CreateRoleWithPermissionsCommand"
} }
} }
], ],
@ -194,12 +194,6 @@
"summary": "Update a custom role.", "summary": "Update a custom role.",
"operationId": "updateRoleWithPermissions", "operationId": "updateRoleWithPermissions",
"parameters": [ "parameters": [
{
"type": "string",
"name": "roleUID",
"in": "path",
"required": true
},
{ {
"name": "body", "name": "body",
"in": "body", "in": "body",
@ -207,6 +201,12 @@
"schema": { "schema": {
"$ref": "#/definitions/UpdateRoleCommand" "$ref": "#/definitions/UpdateRoleCommand"
} }
},
{
"type": "string",
"name": "roleUID",
"in": "path",
"required": true
} }
], ],
"responses": { "responses": {
@ -346,13 +346,6 @@
"summary": "Add team role.", "summary": "Add team role.",
"operationId": "addTeamRole", "operationId": "addTeamRole",
"parameters": [ "parameters": [
{
"type": "integer",
"format": "int64",
"name": "teamId",
"in": "path",
"required": true
},
{ {
"name": "body", "name": "body",
"in": "body", "in": "body",
@ -360,6 +353,13 @@
"schema": { "schema": {
"$ref": "#/definitions/AddTeamRoleCommand" "$ref": "#/definitions/AddTeamRoleCommand"
} }
},
{
"type": "integer",
"format": "int64",
"name": "teamId",
"in": "path",
"required": true
} }
], ],
"responses": { "responses": {
@ -421,7 +421,7 @@
} }
} }
}, },
"/access-control/users/{user_id}/roles": { "/access-control/users/{userId}/roles": {
"get": { "get": {
"description": "Lists the roles that have been directly assigned to a given user. The list does not include built-in roles (Viewer, Editor, Admin or Grafana Admin), and it does not include roles that have been inherited from a team.\n\nYou need to have a permission with action `users.roles:list` and scope `users:id:\u003cuser ID\u003e`.", "description": "Lists the roles that have been directly assigned to a given user. The list does not include built-in roles (Viewer, Editor, Admin or Grafana Admin), and it does not include roles that have been inherited from a team.\n\nYou need to have a permission with action `users.roles:list` and scope `users:id:\u003cuser ID\u003e`.",
"tags": ["access_control", "enterprise"], "tags": ["access_control", "enterprise"],
@ -431,7 +431,7 @@
{ {
"type": "integer", "type": "integer",
"format": "int64", "format": "int64",
"name": "user_id", "name": "userId",
"in": "path", "in": "path",
"required": true "required": true
} }
@ -457,10 +457,18 @@
"summary": "Set user role assignments.", "summary": "Set user role assignments.",
"operationId": "setUserRoles", "operationId": "setUserRoles",
"parameters": [ "parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/SetUserRolesCommand"
}
},
{ {
"type": "integer", "type": "integer",
"format": "int64", "format": "int64",
"name": "user_id", "name": "userId",
"in": "path", "in": "path",
"required": true "required": true
} }
@ -500,7 +508,7 @@
{ {
"type": "integer", "type": "integer",
"format": "int64", "format": "int64",
"name": "user_id", "name": "userId",
"in": "path", "in": "path",
"required": true "required": true
} }
@ -521,29 +529,29 @@
} }
} }
}, },
"/access-control/users/{user_id}/roles/{roleUID}": { "/access-control/users/{userId}/roles/{roleUID}": {
"delete": { "delete": {
"description": "Revoke a role from a user. For bulk updates consider Set user role assignments.\n\nYou need to have a permission with action `users.roles:remove` and scope `permissions:type:delegate`. `permissions:type:delegate` scope ensures that users can only unassign roles which have same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they wont be able to unassign a role which will allow to do that. This is done to prevent escalation of privileges.", "description": "Revoke a role from a user. For bulk updates consider Set user role assignments.\n\nYou need to have a permission with action `users.roles:remove` and scope `permissions:type:delegate`. `permissions:type:delegate` scope ensures that users can only unassign roles which have same, or a subset of permissions which the user has. For example, if a user does not have required permissions for creating users, they wont be able to unassign a role which will allow to do that. This is done to prevent escalation of privileges.",
"tags": ["access_control", "enterprise"], "tags": ["access_control", "enterprise"],
"summary": "Remove a user role assignment.", "summary": "Remove a user role assignment.",
"operationId": "removeUserRole", "operationId": "removeUserRole",
"parameters": [ "parameters": [
{
"type": "string",
"name": "roleUID",
"in": "path",
"required": true
},
{ {
"type": "boolean", "type": "boolean",
"description": "A flag indicating if the assignment is global or not. If set to false, the default org ID of the authenticated user will be used from the request to remove assignment.", "description": "A flag indicating if the assignment is global or not. If set to false, the default org ID of the authenticated user will be used from the request to remove assignment.",
"name": "global", "name": "global",
"in": "query" "in": "query"
}, },
{
"type": "string",
"name": "roleUID",
"in": "path",
"required": true
},
{ {
"type": "integer", "type": "integer",
"format": "int64", "format": "int64",
"name": "user_id", "name": "userId",
"in": "path", "in": "path",
"required": true "required": true
} }
@ -1333,6 +1341,13 @@
"in": "path", "in": "path",
"required": true "required": true
}, },
{
"type": "integer",
"format": "int64",
"name": "user_id",
"in": "path",
"required": true
},
{ {
"name": "body", "name": "body",
"in": "body", "in": "body",
@ -1340,13 +1355,6 @@
"schema": { "schema": {
"$ref": "#/definitions/UpdateUserQuotaCmd" "$ref": "#/definitions/UpdateUserQuotaCmd"
} }
},
{
"type": "integer",
"format": "int64",
"name": "user_id",
"in": "path",
"required": true
} }
], ],
"responses": { "responses": {
@ -1569,14 +1577,8 @@
"description": "Updates an existing notification channel identified by uid.", "description": "Updates an existing notification channel identified by uid.",
"tags": ["legacy_alerts_notification_channels"], "tags": ["legacy_alerts_notification_channels"],
"summary": "Update notification channel by UID.", "summary": "Update notification channel by UID.",
"operationId": "updateAlertNotificationChannelBYUID", "operationId": "updateAlertNotificationChannelByUID",
"parameters": [ "parameters": [
{
"type": "string",
"name": "notification_channel_uid",
"in": "path",
"required": true
},
{ {
"name": "body", "name": "body",
"in": "body", "in": "body",
@ -1584,6 +1586,12 @@
"schema": { "schema": {
"$ref": "#/definitions/UpdateAlertNotificationWithUidCommand" "$ref": "#/definitions/UpdateAlertNotificationWithUidCommand"
} }
},
{
"type": "string",
"name": "notification_channel_uid",
"in": "path",
"required": true
} }
], ],
"responses": { "responses": {
@ -1675,13 +1683,6 @@
"summary": "Update notification channel by ID.", "summary": "Update notification channel by ID.",
"operationId": "updateAlertNotificationChannel", "operationId": "updateAlertNotificationChannel",
"parameters": [ "parameters": [
{
"type": "integer",
"format": "int64",
"name": "notification_channel_id",
"in": "path",
"required": true
},
{ {
"name": "body", "name": "body",
"in": "body", "in": "body",
@ -1689,6 +1690,13 @@
"schema": { "schema": {
"$ref": "#/definitions/UpdateAlertNotificationCommand" "$ref": "#/definitions/UpdateAlertNotificationCommand"
} }
},
{
"type": "integer",
"format": "int64",
"name": "notification_channel_id",
"in": "path",
"required": true
} }
], ],
"responses": { "responses": {
@ -2946,12 +2954,6 @@
"summary": "Updates permissions for a dashboard.", "summary": "Updates permissions for a dashboard.",
"operationId": "postDashboardPermissionsWithUid", "operationId": "postDashboardPermissionsWithUid",
"parameters": [ "parameters": [
{
"type": "string",
"name": "uid",
"in": "path",
"required": true
},
{ {
"name": "Body", "name": "Body",
"in": "body", "in": "body",
@ -2959,6 +2961,12 @@
"schema": { "schema": {
"$ref": "#/definitions/UpdateDashboardAclCommand" "$ref": "#/definitions/UpdateDashboardAclCommand"
} }
},
{
"type": "string",
"name": "uid",
"in": "path",
"required": true
} }
], ],
"responses": { "responses": {
@ -3268,13 +3276,13 @@
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
"name": "uid", "name": "datasource_proxy_route",
"in": "path", "in": "path",
"required": true "required": true
}, },
{ {
"type": "string", "type": "string",
"name": "datasource_proxy_route", "name": "uid",
"in": "path", "in": "path",
"required": true "required": true
} }
@ -3306,15 +3314,23 @@
"summary": "Data source proxy POST calls.", "summary": "Data source proxy POST calls.",
"operationId": "datasourceProxyPOSTByUIDcalls", "operationId": "datasourceProxyPOSTByUIDcalls",
"parameters": [ "parameters": [
{
"name": "DatasourceProxyParam",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
},
{ {
"type": "string", "type": "string",
"name": "uid", "name": "datasource_proxy_route",
"in": "path", "in": "path",
"required": true "required": true
}, },
{ {
"type": "string", "type": "string",
"name": "datasource_proxy_route", "name": "uid",
"in": "path", "in": "path",
"required": true "required": true
} }
@ -3394,13 +3410,13 @@
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
"name": "id", "name": "datasource_proxy_route",
"in": "path", "in": "path",
"required": true "required": true
}, },
{ {
"type": "string", "type": "string",
"name": "datasource_proxy_route", "name": "id",
"in": "path", "in": "path",
"required": true "required": true
} }
@ -3434,10 +3450,12 @@
"deprecated": true, "deprecated": true,
"parameters": [ "parameters": [
{ {
"type": "string", "name": "DatasourceProxyParam",
"name": "id", "in": "body",
"in": "path", "required": true,
"required": true "schema": {
"type": "object"
}
}, },
{ {
"type": "string", "type": "string",
@ -3446,12 +3464,10 @@
"required": true "required": true
}, },
{ {
"name": "DatasourceProxyParam", "type": "string",
"in": "body", "name": "id",
"required": true, "in": "path",
"schema": { "required": true
"type": "object"
}
} }
], ],
"responses": { "responses": {
@ -3561,12 +3577,6 @@
"summary": "Update an existing data source.", "summary": "Update an existing data source.",
"operationId": "updateDatasourceByUID", "operationId": "updateDatasourceByUID",
"parameters": [ "parameters": [
{
"type": "string",
"name": "uid",
"in": "path",
"required": true
},
{ {
"name": "Body", "name": "Body",
"in": "body", "in": "body",
@ -3574,6 +3584,12 @@
"schema": { "schema": {
"$ref": "#/definitions/UpdateDataSourceCommand" "$ref": "#/definitions/UpdateDataSourceCommand"
} }
},
{
"type": "string",
"name": "uid",
"in": "path",
"required": true
} }
], ],
"responses": { "responses": {
@ -3883,12 +3899,6 @@
"operationId": "updateDatasourceByID", "operationId": "updateDatasourceByID",
"deprecated": true, "deprecated": true,
"parameters": [ "parameters": [
{
"type": "string",
"name": "id",
"in": "path",
"required": true
},
{ {
"name": "Body", "name": "Body",
"in": "body", "in": "body",
@ -3896,6 +3906,12 @@
"schema": { "schema": {
"$ref": "#/definitions/UpdateDataSourceCommand" "$ref": "#/definitions/UpdateDataSourceCommand"
} }
},
{
"type": "string",
"name": "id",
"in": "path",
"required": true
} }
], ],
"responses": { "responses": {
@ -4324,6 +4340,12 @@
"summary": "Updates permissions for a folder. This operation will remove existing permissions if theyre not included in the request.", "summary": "Updates permissions for a folder. This operation will remove existing permissions if theyre not included in the request.",
"operationId": "updateFolderPermissions", "operationId": "updateFolderPermissions",
"parameters": [ "parameters": [
{
"type": "string",
"name": "folder_uid",
"in": "path",
"required": true
},
{ {
"name": "Body", "name": "Body",
"in": "body", "in": "body",
@ -4331,12 +4353,6 @@
"schema": { "schema": {
"$ref": "#/definitions/UpdateDashboardAclCommand" "$ref": "#/definitions/UpdateDashboardAclCommand"
} }
},
{
"type": "string",
"name": "folder_uid",
"in": "path",
"required": true
} }
], ],
"responses": { "responses": {
@ -4569,12 +4585,6 @@
"summary": "Update library element.", "summary": "Update library element.",
"operationId": "updateLibraryElement", "operationId": "updateLibraryElement",
"parameters": [ "parameters": [
{
"type": "string",
"name": "library_element_uid",
"in": "path",
"required": true
},
{ {
"name": "body", "name": "body",
"in": "body", "in": "body",
@ -4582,6 +4592,12 @@
"schema": { "schema": {
"$ref": "#/definitions/PatchLibraryElementCommand" "$ref": "#/definitions/PatchLibraryElementCommand"
} }
},
{
"type": "string",
"name": "library_element_uid",
"in": "path",
"required": true
} }
], ],
"responses": { "responses": {
@ -5588,6 +5604,14 @@
"summary": "Update user quota.", "summary": "Update user quota.",
"operationId": "updateOrgQuota", "operationId": "updateOrgQuota",
"parameters": [ "parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/UpdateOrgQuotaCmd"
}
},
{ {
"type": "string", "type": "string",
"name": "quota_target", "name": "quota_target",
@ -5600,14 +5624,6 @@
"name": "org_id", "name": "org_id",
"in": "path", "in": "path",
"required": true "required": true
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/UpdateOrgQuotaCmd"
}
} }
], ],
"responses": { "responses": {
@ -6572,13 +6588,6 @@
"summary": "Update a report.", "summary": "Update a report.",
"operationId": "updateReport", "operationId": "updateReport",
"parameters": [ "parameters": [
{
"type": "integer",
"format": "int64",
"name": "reportID",
"in": "path",
"required": true
},
{ {
"name": "body", "name": "body",
"in": "body", "in": "body",
@ -6586,6 +6595,13 @@
"schema": { "schema": {
"$ref": "#/definitions/CreateOrUpdateConfigCmd" "$ref": "#/definitions/CreateOrUpdateConfigCmd"
} }
},
{
"type": "integer",
"format": "int64",
"name": "reportID",
"in": "path",
"required": true
} }
], ],
"responses": { "responses": {
@ -7135,14 +7151,14 @@
{ {
"type": "integer", "type": "integer",
"format": "int64", "format": "int64",
"name": "groupId", "name": "teamId",
"in": "path", "in": "path",
"required": true "required": true
}, },
{ {
"type": "integer", "type": "integer",
"format": "int64", "format": "int64",
"name": "teamId", "name": "groupId",
"in": "path", "in": "path",
"required": true "required": true
} }
@ -7205,12 +7221,6 @@
"summary": "Update Team.", "summary": "Update Team.",
"operationId": "updateTeam", "operationId": "updateTeam",
"parameters": [ "parameters": [
{
"type": "string",
"name": "team_id",
"in": "path",
"required": true
},
{ {
"name": "body", "name": "body",
"in": "body", "in": "body",
@ -7218,6 +7228,12 @@
"schema": { "schema": {
"$ref": "#/definitions/UpdateTeamCommand" "$ref": "#/definitions/UpdateTeamCommand"
} }
},
{
"type": "string",
"name": "team_id",
"in": "path",
"required": true
} }
], ],
"responses": { "responses": {
@ -7308,6 +7324,14 @@
"summary": "Add Team Member.", "summary": "Add Team Member.",
"operationId": "addTeamMember", "operationId": "addTeamMember",
"parameters": [ "parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/AddTeamMemberCommand"
}
},
{ {
"type": "string", "type": "string",
"name": "team_id", "name": "team_id",
@ -7340,12 +7364,6 @@
"summary": "Update Team Member.", "summary": "Update Team Member.",
"operationId": "updateTeamMember", "operationId": "updateTeamMember",
"parameters": [ "parameters": [
{
"type": "string",
"name": "team_id",
"in": "path",
"required": true
},
{ {
"name": "body", "name": "body",
"in": "body", "in": "body",
@ -7354,6 +7372,12 @@
"$ref": "#/definitions/UpdateTeamMemberCommand" "$ref": "#/definitions/UpdateTeamMemberCommand"
} }
}, },
{
"type": "string",
"name": "team_id",
"in": "path",
"required": true
},
{ {
"type": "integer", "type": "integer",
"format": "int64", "format": "int64",
@ -7779,7 +7803,7 @@
"description": "Revokes the given auth token (device) for the actual user. User of issued auth token (device) will no longer be logged in and will be required to authenticate again upon next activity.", "description": "Revokes the given auth token (device) for the actual user. User of issued auth token (device) will no longer be logged in and will be required to authenticate again upon next activity.",
"tags": ["signed_in_user"], "tags": ["signed_in_user"],
"summary": "Revoke an auth token of the actual User.", "summary": "Revoke an auth token of the actual User.",
"operationId": "revokeSignedINAuthTokenCmd", "operationId": "revokeSignedInAuthToken",
"parameters": [ "parameters": [
{ {
"name": "body", "name": "body",
@ -8064,13 +8088,6 @@
"summary": "Update user.", "summary": "Update user.",
"operationId": "updateUser", "operationId": "updateUser",
"parameters": [ "parameters": [
{
"type": "integer",
"format": "int64",
"name": "user_id",
"in": "path",
"required": true
},
{ {
"description": "To change the email, name, login, theme, provide another one.", "description": "To change the email, name, login, theme, provide another one.",
"name": "body", "name": "body",
@ -8079,6 +8096,13 @@
"schema": { "schema": {
"$ref": "#/definitions/UpdateUserCommand" "$ref": "#/definitions/UpdateUserCommand"
} }
},
{
"type": "integer",
"format": "int64",
"name": "user_id",
"in": "path",
"required": true
} }
], ],
"responses": { "responses": {
@ -9441,6 +9465,9 @@
"provisionedExternalId": { "provisionedExternalId": {
"type": "string" "type": "string"
}, },
"publicDashboardUid": {
"type": "string"
},
"slug": { "slug": {
"type": "string" "type": "string"
}, },