Merge pull request #1144 from vmware/revert-1143-master-update-swagger

Revert "Updates Swagger YAML for new added APIs."
This commit is contained in:
kun wang 2016-11-22 18:42:54 +08:00 committed by GitHub
commit 2dee9c7b90
2 changed files with 2 additions and 56 deletions

View File

@ -1309,41 +1309,7 @@ paths:
403:
description: User does not have permission of admin role.
500:
description: Unexpected internal errors.
/systeminfo/volumes:
get:
summary: Get system volume info (total/free size).
description: |
This endpoint is for retrieving system volume info that only provides for admin user.
tags:
- Products
responses:
200:
description: Get system volumes successfully.
401:
description: User need to log in first.
403:
description: User does not have permission of admin role.
500:
description: Unexpected internal errors.
/systeminfo/getcert:
get:
summary: Get default root certificate under OVA deployment.
description: |
This endpoint is for downloading a default root certificate that only provides for admin user under OVA deployment.
tags:
- Products
responses:
200:
description: Get default root certificate successfully.
401:
description: User need to log in first.
403:
description: User does not have permission of admin role.
404:
description: Not found the default root certificate.
500:
description: Unexpected internal errors.
description: Unexpected internal errors.
definitions:
Search:
type: object
@ -1775,22 +1741,3 @@ definitions:
comment:
type: string
description: The new comment.
Storage:
type: object
properties:
total:
type: integer
format: int64
description: Total volume size.
free:
type: integer
format: int64
description: Free volume size.
SystemInfo:
type: object
properties:
storage:
type: array
description: The storage of system.
items:
$ref: '#/definitions/Storage'

View File

@ -73,7 +73,6 @@ func (sia *SystemInfoAPI) GetVolumeInfo() {
func (sia *SystemInfoAPI) GetCert() {
if sia.isAdmin {
if _, err := os.Stat(defaultRootCert); !os.IsNotExist(err) {
sia.Ctx.Output.Header("Content-Type", "application/octet-stream")
sia.Ctx.Output.Header("Content-Disposition", "attachment; filename=ca.crt")
http.ServeFile(sia.Ctx.ResponseWriter, sia.Ctx.Request, defaultRootCert)
} else {
@ -81,5 +80,5 @@ func (sia *SystemInfoAPI) GetCert() {
sia.CustomAbort(http.StatusNotFound, "No certificate found.")
}
}
sia.CustomAbort(http.StatusForbidden, "")
sia.CustomAbort(http.StatusUnauthorized, "")
}