Change how query parameters are handled

This commit is contained in:
Quentin Dufour 2023-11-22 20:39:38 +01:00
parent 3684c29ad0
commit 4f473f43c9
No known key found for this signature in database
GPG key ID: E9602264D639FF68

View file

@ -283,7 +283,7 @@ paths:
'200': '200':
description: "The staged layout has been cleared, you can start again sending modification from a fresh copy with `POST /layout`." description: "The staged layout has been cleared, you can start again sending modification from a fresh copy with `POST /layout`."
/key: "/key?list":
get: get:
tags: tags:
- Key - Key
@ -349,7 +349,7 @@ paths:
schema: schema:
$ref: '#/components/schemas/KeyInfo' $ref: '#/components/schemas/KeyInfo'
"/key?id={access_key}": "/key":
get: get:
tags: tags:
- Key - Key
@ -357,16 +357,28 @@ paths:
summary: "Get key information" summary: "Get key information"
description: | description: |
Return information about a specific key like its identifiers, its permissions and buckets on which it has permissions. Return information about a specific key like its identifiers, its permissions and buckets on which it has permissions.
You can search by specifying the exact key identifier (`id`) or by specifying a pattern (`search`).
For confidentiality reasons, the secret key is not returned by default: you must pass the `showSecretKey` query parameter to get it. For confidentiality reasons, the secret key is not returned by default: you must pass the `showSecretKey` query parameter to get it.
parameters: parameters:
- name: access_key - name: id
in: path in: query
required: true description: |
description: "The exact API access key generated by Garage" The exact API access key generated by Garage.
Incompatible with `search`.
example: "GK31c2f218a2e44f485b94239e" example: "GK31c2f218a2e44f485b94239e"
schema: schema:
type: string type: string
- name: search
in: query
description: |
A pattern (beginning or full string) corresponding to a key identifier or friendly name.
Incompatible with `id`.
example: "test-k"
schema:
type: string
- name: showSecretKey - name: showSecretKey
in: query in: query
schema: schema:
@ -464,43 +476,6 @@ paths:
$ref: '#/components/schemas/KeyInfo' $ref: '#/components/schemas/KeyInfo'
"/key?search={pattern}":
get:
tags:
- Key
operationId: "SearchKey"
summary: "Select key by pattern"
description: |
Find the first key matching the given pattern based on its identifier or friendly name and return its information.
For confidentiality reasons, the secret key is not returned by default: you must pass the `showSecretKey` query parameter to get it.
parameters:
- name: pattern
in: path
required: true
description: "A pattern (beginning or full string) corresponding to a key identifier or friendly name"
example: "test-k"
schema:
type: string
- name: showSecretKey
in: query
schema:
type: boolean
default: false
example: true
required: false
description: "Wether or not the secret key should be returned in the response"
responses:
'500':
description: "The server can not handle your request. Check your connectivity with the rest of the cluster."
'200':
description: |
Returns information about the key
content:
application/json:
schema:
$ref: '#/components/schemas/KeyInfo'
/key/import: /key/import:
post: post:
tags: tags:
@ -543,7 +518,7 @@ paths:
schema: schema:
$ref: '#/components/schemas/KeyInfo' $ref: '#/components/schemas/KeyInfo'
/bucket: "/bucket?list":
get: get:
tags: tags:
- Bucket - Bucket
@ -599,6 +574,8 @@ paths:
type: string type: string
accessKeyId: accessKeyId:
type: string type: string
/bucket:
post: post:
tags: tags:
- Bucket - Bucket
@ -650,27 +627,35 @@ paths:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/BucketInfo' $ref: '#/components/schemas/BucketInfo'
"/bucket?id={bucket_id}":
get: get:
tags: tags:
- Bucket - Bucket
operationId: "GetBucketInfo" operationId: "GetBucketInfo"
summary: "Get a bucket" summary: "Get a bucket"
description: | description: |
Given a bucket identifier, get its information. Given a bucket identifier (`id`) or a global alias (`alias`), get its information.
It includes its aliases, its web configuration, keys that have some permissions It includes its aliases, its web configuration, keys that have some permissions
on it, some statistics (number of objects, size), number of dangling multipart uploads, on it, some statistics (number of objects, size), number of dangling multipart uploads,
and its quotas (if any). and its quotas (if any).
parameters: parameters:
- name: bucket_id - name: id
in: path in: query
required: true description: |
description: "The exact bucket identifier, a 32 bytes hexadecimal string" The exact bucket identifier, a 32 bytes hexadecimal string.
Incompatible with `alias`.
example: "b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87" example: "b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87"
schema: schema:
type: string type: string
- name: alias
in: query
description: |
The exact global alias of one of the existing buckets.
Incompatible with `id`.
example: "my_documents"
schema:
type: string
responses: responses:
'500': '500':
description: "The server can not handle your request. Check your connectivity with the rest of the cluster." description: "The server can not handle your request. Check your connectivity with the rest of the cluster."
@ -694,8 +679,8 @@ paths:
**Warning:** this will delete all aliases associated with the bucket! **Warning:** this will delete all aliases associated with the bucket!
parameters: parameters:
- name: bucket_id - name: id
in: path in: query
required: true required: true
description: "The exact bucket identifier, a 32 bytes hexadecimal string" description: "The exact bucket identifier, a 32 bytes hexadecimal string"
example: "b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87" example: "b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87"
@ -731,8 +716,8 @@ paths:
to remove the quotas. An absent value will be considered the same as a `null`. It is not possible to remove the quotas. An absent value will be considered the same as a `null`. It is not possible
to change only one of the two quotas. to change only one of the two quotas.
parameters: parameters:
- name: bucket_id - name: id
in: path in: query
required: true required: true
description: "The exact bucket identifier, a 32 bytes hexadecimal string" description: "The exact bucket identifier, a 32 bytes hexadecimal string"
example: "b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87" example: "b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87"
@ -788,34 +773,6 @@ paths:
schema: schema:
$ref: '#/components/schemas/BucketInfo' $ref: '#/components/schemas/BucketInfo'
"/bucket?globalAlias={alias}":
get:
tags:
- Bucket
operationId: "FindBucketInfo"
summary: "Find a bucket"
description: |
Find a bucket by its global alias
parameters:
- name: alias
in: path
required: true
description: "The exact global alias of one of the existing buckets"
example: "my_documents"
schema:
type: string
responses:
'500':
description: "The server can not handle your request. Check your connectivity with the rest of the cluster."
'404':
description: "Bucket not found"
'200':
description: Returns exhaustive information about the bucket
content:
application/json:
schema:
$ref: '#/components/schemas/BucketInfo'
/bucket/allow: /bucket/allow:
post: post:
tags: tags: