Merge pull request #316 from reasonerjt/api-attributes

swagger update
This commit is contained in:
Daniel Jiang 2016-06-06 14:06:51 +08:00
commit cfa56fee61

View File

@ -4,7 +4,7 @@ swagger: '2.0'
info:
title: Harbor API
description: These APIs provide services for manipulating Harbor project.
version: "0.1.0"
version: "0.1.1"
# the domain of the service
host: localhost
# array of all schemes that your API supports
@ -167,7 +167,7 @@ paths:
- name: access_log
in: body
schema:
$ref: '#/definitions/AccessLog'
$ref: '#/definitions/AccessLogFilter'
description: Search results of access logs.
tags:
- Products
@ -204,7 +204,7 @@ paths:
schema:
type: array
items:
$ref: '#/definitions/Role'
$ref: '#/definitions/User'
400:
description: Illegal format of provided ID value.
401:
@ -517,7 +517,7 @@ paths:
schema:
type: array
items:
$ref: '#/definitions/Repository'
type: string
400:
description: Invalid project ID.
403:
@ -605,12 +605,41 @@ definitions:
description: Search results of the projects that matched the filter keywords.
type: array
items:
$ref: '#/definitions/Project'
$ref: '#/definitions/SearchProject'
repositories:
description: Search results of the repositories that matched the filter keywords.
type: array
items:
$ref: '#/definitions/Repository'
$ref: '#/definitions/SearchRepository'
SearchProject:
type: object
properties:
id:
type: integer
format: int64
description: The ID of project
name:
type: string
description: The name of the project
public:
type: integer
format: int
description: The flag to indicate the publicity of the project (1 is public, 0 is non-public)
SearchRepository:
type: object
properties:
repository_name:
type: string
description: The name of the repository
project_name:
type: string
description: The name of the project that the repository belongs to
project_id:
type: integer
description: The ID of the project that the repository belongs to
project_public:
type: integer
description: The flag to indicate the publicity of the project that the repository belongs to (1 is public, 0 is not)
Project:
type: object
properties:
@ -622,30 +651,39 @@ definitions:
type: integer
format: int32
description: The owner ID of the project always means the creator of the project.
project_name:
name:
type: string
description: The name of the project.
creation_time:
type: string
description: The creation time of the project.
update_time:
type: string
description: The update time of the project.
deleted:
type: integer
format: int32
description: A deletion mark of the project.
description: A deletion mark of the project (1 means it's deleted, 0 is not)
user_id:
type: integer
format: int32
description: A relation field to the user table.
owner_name:
type: string
description: The owner name of tthe project always means the creator of the project.
description: The owner name of the project.
public:
type: boolean
format: boolean
description: The public status of the project.
togglable:
type: boolean
description: Correspond to the UI about showing the public status of the project.
description: Correspond to the UI about whether the project's publicity is updatable (for UI)
current_user_role_id:
type: integer
description: The role ID of the current user who triggered the API (for UI)
repo_count:
type: integer
description: The number of the repositories under this project.
Repository:
type: object
properties:
@ -680,6 +718,7 @@ definitions:
user_id:
type: integer
format: int32
description: The ID of the user.
username:
type: string
email:
@ -702,7 +741,7 @@ definitions:
new_password:
type: string
description: New password for marking as to be updated.
AccessLog:
AccessLogFilter:
type: object
properties:
username:
@ -711,14 +750,32 @@ definitions:
keywords:
type: string
description: Operation name specified when project created.
beginTimestamp:
begin_timestamp:
type: integer
format: int32
format: int64
description: Begin timestamp for querying access logs.
endTimestamp:
end_timestamp:
type: integer
format: int32
format: int64
description: End timestamp for querying accessl logs.
AccessLog:
type: object
properties:
log_id:
type: integer
description: The ID of the log entry.
repo_name:
type: string
description: Name of the repository in this log entry.
repo_tag:
type: string
description: Tag of the repository in this log entry.
operation:
type: string
description: The operation against the repository in this log entry.
op_time:
type: time
description: The time when this operation is triggered.
Role:
type: object
properties:
@ -741,6 +798,6 @@ definitions:
type: integer
format: int32
description: Role ID for updating project role member.
user_name:
username:
type: string
description: Username relevant to a project role member.