swagger: '2.0'
info: title: Cargo API description: | Cargo Object Service API version: "0.0.1" contact: name: JungleBit Corp license: name: JungleBit Corp host: localhost:8080 basePath: /092024 schemes:
- https consumes:
- application/json produces:
- application/json securityDefinitions: key: type: apiKey in: header name: Authorization security:
- key: [] paths: /: get: summary: List Buckets x-example: | GET HTTP/1.1 Host: ??? Date: ??? Authorization: ??? responses: 200: description: List the buckets headers: x-request-id: type: string examples: application-json: | schema: type: array items: $ref: '#/definitions/BucketSummary' 400: $ref: '#/responses/BadRequest' 401: $ref: '#/responses/NotAuthenticated' 403: $ref: '#/responses/Forbidden' 408: $ref: '#/responses/RequestTimeout' 500: $ref: '#/responses/InternalServerError' default: $ref: '#/responses/Error' post: summary: Create bucket parameters: - $ref: '#/parameters/ClientRequestIdHeader' - name: CreateBucketDetails description: Create bucket details in: body schema: $ref: '#/definitions/CreateBucketDetails' responses: 200: description: OK schema: $ref: '#/definitions/Bucket' headers: client-request-id: type: string x-request-id: type: string ETag: type: string 400: $ref: '#/responses/BadRequest' 401: $ref: '#/responses/NotAuthenticated' 404: $ref: '#/responses/NotAuthorizedOrNotFound' 408: $ref: '#/responses/RequestTimeout' 409: $ref: '#/responses/NotAuthorizedOrInternalConflict' 500: $ref: '#/responses/InternalServerError' default: $ref: '#/responses/Error' /{bucket}: get: summary: List Objects description: | Lists up to 1000 objects in the bucket parameters: - $ref: '#/parameters/PageQueryParam' - $ref: '#/parameters/LimitQueryParam' - $ref: '#/parameters/ClientRequestIdHeader' - $ref: '#/parameters/BucketPathParam' x-example: | GET /bucket HTTP/1.1 Host: localhost:8080 connection: keep-alive accept-encoding: gzip, deflate accept: / user-agent: python-requests/3.9.0 date: Tue, Sep 2024 08:00:00 GMT authorization: ??? responses: 200: description: List objects headers: x-request-id: type: string examples: application-json: | 400: $ref: '#/responses/BadRequest' 401: $ref: '#/responses/NotAuthenticated' 403: $ref: '#/responses/Forbidden' 408: $ref: '#/responses/RequestTimeout' 500: $ref: '#/responses/InternalServerError' default: $ref: '#/responses/Error' head: summary: Head Bucket description: Check if bucket exists parameters: - $ref: '#/parameters/BucketPathParam' responses: 200: description: Success headers: client-request-id: type: string x-request-id: type: string ETag: type: string 304: $ref: '#/responses/NotModified' 400: $ref: '#/responses/BadRequest' 401: $ref: '#/responses/NotAuthenticated' 404: $ref: '#/responses/NotAuthorizedOrNotFound' 408: $ref: '#/responses/RequestTimeout' 412: $ref: '#/responses/PreconditionFailed' 500: $ref: '#/responses/InternalServerError' default: $ref: '#/responses/Error' post: summary: Post Bucket description: Update a bucket parameters: - $ref: '#/parameters/BucketPathParam' - name: UpdateBucketDetails description: Details required: true in: body schema: $ref: '#/definitions/UpdateBucketDetails' responses: 200: description: Success schema: $ref: '#/definitions/Bucket' headers: client-request-id: type: string x-request-id: type: string ETag: type: string 400: $ref: '#/responses/BadRequest' 401: $ref: '#/responses/NotAuthenticated' 404: $ref: '#/responses/NotAuthorizedOrNotFound' 408: $ref: '#/responses/RequestTimeout' 409: $ref: '#/responses/NotAuthorizedOrInternalConflict' 412: $ref: '#/responses/PreconditionFailed' 500: $ref: '#/responses/InternalServerError' default: $ref: '#/responses/Error' delete: summary: Delete bucket parameters: - $ref: '#/parameters/BucketPathParam' - $ref: '#/parameters/IfMatchHeader' - $ref: '#/parameters/ClientRequestIdHeader' responses: 204: description: Deleted headers: client-request-id: type: string x-request-id: type: string 400: $ref: '#/responses/BadRequest' 401: $ref: '#/responses/NotAuthenticated' 404: $ref: '#/responses/NotAuthorizedOrNotFound' 409: $ref: '#/responses/NotAuthorizedOrInternalConflict' 500: $ref: '#/responses/InternalServerError' default: $ref: '#/responses/Error' /{bucket}/{object}: get: summary: Get object description: Get object parameters: - $ref: '#/parameters/BucketPathParam' - $ref: '#/parameters/ObjectPathParam' x-example: GET /<bucket>/<object> responses: 200: description: Object data and metadata schema: type: string format: binary headers: client-request-id: type: string x-request-id: type: string ETag: type: string content-length: type: integer format: int64 content-range: type: string content-sha256: type: string content-type: type: string last-modified: type: string format: date-time versionId: type: integer format: int64 304: $ref: '#/responses/NotModified' 400: $ref: '#/responses/BadRequest' 401: $ref: '#/responses/NotAuthenticated' 404: $ref: '#/responses/NotAuthorizedOrNotFound' 408: $ref: '#/responses/RequestTimeout' 409: $ref: '#/responses/NotAuthorizedOrInternalConflict' 412: $ref: '#/responses/PreconditionFailed' 500: $ref: '#/responses/InternalServerError' default: $ref: '#/responses/Error' put: description: Put Object parameters: - $ref: '#/parameters/BucketPathParam' - $ref: '#/parameters/ObjectPathParam' - name: PutObjectBody required: true in: body schema: type: string format: binary responses: 200: description: Success headers: client-request-id: type: string x-request-id: type: string ETag: type: string content-sha256: type: string head: description: Return the user defined metadata parameters: - $ref: '#/parameters/BucketPathParam' - $ref: '#/parameters/ObjectPathParam' responses: 200: description: Success headers: client-request-id: type: string x-request-id: type: string ETag: type: string content-length: type: integer format: int64 content-sha256: type: string 304: $ref: '#/responses/NotModified' 400: $ref: '#/responses/BadRequest' 401: $ref: '#/responses/NotAuthenticated' 404: $ref: '#/responses/NotAuthorizedOrNotFound' 408: $ref: '#/responses/RequestTimeout' 412: $ref: '#/responses/PreconditionFailed' 500: $ref: '#/responses/InternalServerError' default: $ref: '#/responses/Error' delete: description: Delete Object parameters: - $ref: '#/parameters/BucketPathParam' - $ref: '#/parameters/ObjectPathParam' responses: 204: description: Success headers: client-request-id: type: string x-request-id: type: string 400: $ref: '#/responses/BadRequest' 401: $ref: '#/responses/NotAuthenticated' 403: $ref: '#/responses/Forbidden' 404: $ref: '#/responses/NotAuthorizedOrNotFound' 408: $ref: '#/responses/RequestTimeout' 409: $ref: '#/responses/NotAuthorizedOrInternalConflict' 412: $ref: '#/responses/PreconditionFailed' 500: $ref: '#/responses/InternalServerError' default: $ref: '#/responses/Error'
parameters: BucketPathParam: name: bucket in: path type: string required: true pattern: '[a-zA-Z0-9\-_\.]+' minLength: 1 maxLength: 128 description: Bucket name ObjectPathParam: name: object in: path type: string required: true pattern: '[^\\r\\n\\00#\\?]+' minLength: 1 maxLength: 1024 description: Object name DelimiterQueryParam: name: delimiter in: query type: string description: Delimiter PrefixQueryParam: name: prefix in: query type: string description: Prefix PageQueryParam: name: page in: query type: string description: Page LimitQueryParam: name: limit in: query type: integer description: Limit ClientRequestIdHeader: name: client-request-id in: header type: string description: Client request Id IfMatchHeader: name: if-match in: header type: string description: If match responses: Error: description: A description for an error schema: $ref: '#/definitions/Error' headers: x-request-id: type: string
NotModified: description: Not Modified headers: client-request-id: type: string x-request-id: type: string
BadRequest: description: Bad request headers: x-request-id: type: string schema: $ref: '#/definitions/Error'
NotAuthenticated: description: Not authenticated headers: x-request-id: type: string schema: $ref: '#/definitions/Error'
Forbidden: description: Forbidden headers: x-request-id: type: string schema: $ref: '#/definitions/Error'
NotAuthorizedOrNotFound: description: Not found headers: x-request-id: type: string schema: $ref: '#/definitions/Error'
RequestTimeout: description: Request timeout headers: x-request-id: type: string schema: $ref: '#/definitions/Error'
NotAuthorizedOrInternalConflict: description: Conflict headers: x-request-id: type: string schema: $ref: '#/definitions/Error'
PreconditionFailed: description: Precondition failed headers: x-request-id: type: string schema: $ref: '#/definitions/Error'
InternalServerError: description: Internal server error headers: x-request-id: type: string schema: $ref: '#/definitions/Error'
definitions: principal: type: string Bucket: description: Bucket description required: - name - createdOn - createdBy - etag properties: name: type: string description: Bucket Name createdOn: type: string format: date-time description: Date time bucket was created on createdBy: type: string description: User who created the bucket etag: type: string description: ETag for the bucket durability: type: string enum: - 3x - 5x - 7x - 2+1 - 2+3 - 4+3 description: Durability versioning: type: string enum: - Enabled - Disabled description: Versioning on the bucket objects BucketSummary: description: Bucket summary required: - name - createdOn - createdBy - etag properties: name: type: string description: Bucket Name createdOn: type: string format: date-time description: Date time bucket was created on createdBy: type: string description: User who created the bucket etag: type: string description: ETag for the bucket CreateBucketDetails: description: Create bucket details required: - name properties: name: type: string description: Name versioning: type: string enum: - Enabled - Disabled UpdateBucketDetails: description: Update bucket details properties: name: type: string description: Bucket name versing: type: string enum: - Enabled - Disabled ObjectSummary: description: Object summary required: - name properties: name: type: string description: Object name size: type: integer format: int64 description: Object size in bytes sha256: type: string description: sha256 hash createdOn: type: string format: date-time description: Date time the object was created createdBy: type: string description: User who created the object etag: type: string description: ETag for the object modifiedOn: type: string format: date-time description: Date time the object was last modified versionId: type: integer format: int64 description: Version Id Error: required: - code - message properties: code: type: string message: type: string Tag: description: key/value pair of a tag required: - key - value properties: key: type: string value: type: string