From d35ed36839a57d873097ad909eb716c3d8332d29 Mon Sep 17 00:00:00 2001 From: guyhardonag Date: Wed, 4 Nov 2020 10:16:12 +0200 Subject: [PATCH] add endpoint for export --- docs/assets/js/swagger.yml | 88 +++++++++++++++++++++++++------------- swagger.yml | 86 +++++++++++++++++++++++++------------ 2 files changed, 117 insertions(+), 57 deletions(-) diff --git a/docs/assets/js/swagger.yml b/docs/assets/js/swagger.yml index 032a5618615..aeca552ee9f 100644 --- a/docs/assets/js/swagger.yml +++ b/docs/assets/js/swagger.yml @@ -1,16 +1,16 @@ swagger: "2.0" consumes: -- application/json + - application/json info: description: lakeFS HTTP API title: lakeFS API version: 0.1.0 produces: -- application/json + - application/json schemes: -- http -- https + - http + - https basePath: /api/v1 @@ -24,8 +24,8 @@ securityDefinitions: security: - - basic_auth: [] - - jwt_token: [] + - basic_auth: [ ] + - jwt_token: [ ] responses: Unauthorized: @@ -116,7 +116,7 @@ definitions: format: int64 path_type: type: string - enum: [common_prefix, object] + enum: [ common_prefix, object ] underlying_object_properties: type: object @@ -130,12 +130,12 @@ definitions: properties: type: type: string - enum: [added, removed, changed, conflict] + enum: [ added, removed, changed, conflict ] path: type: string path_type: type: string - enum: [common_prefix, object] + enum: [ common_prefix, object ] revert_creation: type: object @@ -144,7 +144,7 @@ definitions: properties: type: type: string - enum: [object, common_prefix, commit, reset] + enum: [ object, common_prefix, commit, reset ] commit: type: string path: @@ -279,7 +279,7 @@ definitions: properties: effect: type: string - enum: [allow, deny] + enum: [ allow, deny ] resource: type: string action: @@ -318,12 +318,12 @@ definitions: type: string format: uri x-nullable: false # Override https://github.com/go-swagger/go-swagger/issues/1188 - # go-swagger totally not a bug. This causes the generated field - # *not* to be a pointer. Then the regular (incorrect, in this - # case) JSON parser parses it as an empty field, and validation - # verifies the value is non-empty. In *this particular case* it - # works because a URI cannot be empty (at least not an absolute - # URI, which is what we require). + # go-swagger totally not a bug. This causes the generated field + # *not* to be a pointer. Then the regular (incorrect, in this + # case) JSON parser parses it as an empty field, and validation + # verifies the value is non-empty. In *this particular case* it + # works because a URI cannot be empty (at least not an absolute + # URI, which is what we require). description: export objects to this path example: s3://company-bucket/path/to/export exportStatusPath: @@ -336,7 +336,7 @@ definitions: items: type: string description: "list of regexps of keys to exported last in each prefix (for signalling)" - example: ["^SUCCESS$", ".*/_SUCCESS$"] + example: [ "^SUCCESS$", ".*/_SUCCESS$" ] retention_policy: type: object @@ -369,7 +369,7 @@ definitions: properties: status: type: string - enum: [enabled, disabled] + enum: [ enabled, disabled ] filter: type: object properties: @@ -389,8 +389,8 @@ definitions: time_period: type: object description: | - a number of days, which can be broken up into a sum of weeks - and days + a number of days, which can be broken up into a sum of weeks + and days properties: weeks: type: integer @@ -401,10 +401,10 @@ definitions: minProperties: 1 config: - type: object - properties: - blockstore.type: - type: string + type: object + properties: + blockstore.type: + type: string paths: @@ -414,7 +414,7 @@ paths: - setup operationId: setupLakeFS summary: setup lakeFS and create the first user - security: [] + security: [ ] parameters: - in: body name: user @@ -2011,12 +2011,42 @@ paths: schema: $ref: "#/definitions/error" - /repositories/{repository}/retention: + /repositories/{repository}/branches/{branch}/export-hook: parameters: - in: path name: repository required: true type: string + - in: path + name: branch + required: true + type: string + post: + tags: + - export + - branches + operationId: executeContinuousExport + summary: hook to be called in order to execute continues export on branch + responses: + 201: + description: continuous export successfully started + 401: + $ref: "#/responses/Unauthorized" + 404: + description: no branch defined at that repo + schema: + $ref: "#/definitions/error" + default: + description: generic error response + schema: + $ref: "#/definitions/error" + + /repositories/{repository}/retention: + parameters: + - in: path + name: repository + required: true + type: string put: tags: - retention @@ -2057,14 +2087,14 @@ paths: /healthcheck: get: operationId: healthCheck - security: [] + security: [ ] tags: - healthCheck description: check that the API server is up and running responses: 204: description: NoContent - + /config: get: tags: diff --git a/swagger.yml b/swagger.yml index 032a5618615..a5919eb2847 100644 --- a/swagger.yml +++ b/swagger.yml @@ -1,16 +1,16 @@ swagger: "2.0" consumes: -- application/json + - application/json info: description: lakeFS HTTP API title: lakeFS API version: 0.1.0 produces: -- application/json + - application/json schemes: -- http -- https + - http + - https basePath: /api/v1 @@ -24,8 +24,8 @@ securityDefinitions: security: - - basic_auth: [] - - jwt_token: [] + - basic_auth: [ ] + - jwt_token: [ ] responses: Unauthorized: @@ -116,7 +116,7 @@ definitions: format: int64 path_type: type: string - enum: [common_prefix, object] + enum: [ common_prefix, object ] underlying_object_properties: type: object @@ -130,12 +130,12 @@ definitions: properties: type: type: string - enum: [added, removed, changed, conflict] + enum: [ added, removed, changed, conflict ] path: type: string path_type: type: string - enum: [common_prefix, object] + enum: [ common_prefix, object ] revert_creation: type: object @@ -144,7 +144,7 @@ definitions: properties: type: type: string - enum: [object, common_prefix, commit, reset] + enum: [ object, common_prefix, commit, reset ] commit: type: string path: @@ -279,7 +279,7 @@ definitions: properties: effect: type: string - enum: [allow, deny] + enum: [ allow, deny ] resource: type: string action: @@ -318,12 +318,12 @@ definitions: type: string format: uri x-nullable: false # Override https://github.com/go-swagger/go-swagger/issues/1188 - # go-swagger totally not a bug. This causes the generated field - # *not* to be a pointer. Then the regular (incorrect, in this - # case) JSON parser parses it as an empty field, and validation - # verifies the value is non-empty. In *this particular case* it - # works because a URI cannot be empty (at least not an absolute - # URI, which is what we require). + # go-swagger totally not a bug. This causes the generated field + # *not* to be a pointer. Then the regular (incorrect, in this + # case) JSON parser parses it as an empty field, and validation + # verifies the value is non-empty. In *this particular case* it + # works because a URI cannot be empty (at least not an absolute + # URI, which is what we require). description: export objects to this path example: s3://company-bucket/path/to/export exportStatusPath: @@ -336,7 +336,7 @@ definitions: items: type: string description: "list of regexps of keys to exported last in each prefix (for signalling)" - example: ["^SUCCESS$", ".*/_SUCCESS$"] + example: [ "^SUCCESS$", ".*/_SUCCESS$" ] retention_policy: type: object @@ -369,7 +369,7 @@ definitions: properties: status: type: string - enum: [enabled, disabled] + enum: [ enabled, disabled ] filter: type: object properties: @@ -389,8 +389,8 @@ definitions: time_period: type: object description: | - a number of days, which can be broken up into a sum of weeks - and days + a number of days, which can be broken up into a sum of weeks + and days properties: weeks: type: integer @@ -401,10 +401,10 @@ definitions: minProperties: 1 config: - type: object - properties: - blockstore.type: - type: string + type: object + properties: + blockstore.type: + type: string paths: @@ -414,7 +414,7 @@ paths: - setup operationId: setupLakeFS summary: setup lakeFS and create the first user - security: [] + security: [ ] parameters: - in: body name: user @@ -2011,6 +2011,36 @@ paths: schema: $ref: "#/definitions/error" + /repositories/{repository}/branches/{branch}/export-hook: + parameters: + - in: path + name: repository + required: true + type: string + - in: path + name: branch + required: true + type: string + post: + tags: + - export + - branches + operationId: executeContinuousExport + summary: hook to be called in order to execute continues export on branch + responses: + 201: + description: continuous export successfully started + 401: + $ref: "#/responses/Unauthorized" + 404: + description: no branch defined at that repo + schema: + $ref: "#/definitions/error" + default: + description: generic error response + schema: + $ref: "#/definitions/error" + /repositories/{repository}/retention: parameters: - in: path @@ -2057,14 +2087,14 @@ paths: /healthcheck: get: operationId: healthCheck - security: [] + security: [ ] tags: - healthCheck description: check that the API server is up and running responses: 204: description: NoContent - + /config: get: tags: