Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document rename endpoints #102

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 76 additions & 1 deletion docs/http-api/bucket-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ parameters are empty.
If authentication is enabled, the method needs a valid API token with full
access.

**Changes**:

- v1.12: HARD quota type was introduced.

<SwaggerComponent
method="POST"
path="/api/v1/b/:bucket_name"
Expand Down Expand Up @@ -231,6 +235,10 @@ with all the settings.

If authentication is enabled, the method needs a valid API token with full access.

**Changes**:

- v1.12: HARD quota type was introduced.

<SwaggerComponent
method="PUT"
path="/api/v1/b/:bucket_name"
Expand Down Expand Up @@ -266,7 +274,7 @@ If authentication is enabled, the method needs a valid API token with full acces
type: "body",
details: {
name: "quota_type",
description: "Type of quota. Can have values 'NONE' or 'FIFO'",
description: "Type of quota. Can have values 'NONE', 'FIFO' or 'HARD'",
dataType: "String",
isRequired: false,
},
Expand Down Expand Up @@ -315,6 +323,73 @@ If authentication is enabled, the method needs a valid API token with full acces
]}
/>

## Rename a Bucket

To rename a bucket, the request should have a JSON document with the new name.

If authentication is enabled, the method needs a valid API token with full access.

**Changes**:

- v1.12: the endpoint was introduced.

<SwaggerComponent
method="PUT"
path="/api/v1/b/:bucket_name/rename"
summary="Rename a bucket"
parameters={[
{
type: "path",
details: {
name: ":bucket_name",
description: "Name of bucket",
isRequired: true,
},
},
{
type: "body",
details: {
name: "new_name",
description: "New name of the bucket",
dataType: "String",
isRequired: true,
},
},
]}
responses={[
{
status: "200",
message: "OK",
summary: "The bucket is renamed",
},
{
status: "401",
message: "Unauthorized",
summary: "Access token is invalid or empty",
},
{
status: "403",
message: "Forbidden",
summary: "Access token doesn't have enough permissions",
},
{
status: "404",
message: "Not Found",
summary: "Bucket doesn't exist",
},
{
status: "409",
message: "Conflict",
summary: "Bucket with the new name already exists",
},
{
status: "422",
message: "Unprocessable Entity",
summary: "JSON request is invalid",
},
]}
/>

## Remove a Bucket

Remove a bucket with all its entries and stored data.
Expand Down
84 changes: 76 additions & 8 deletions docs/http-api/entry-api/update_data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ if authentication is enabled.
{
type: "header",
details: {
name: "x-reduct-label-<name>",
name: "x-reduct-label-[name]",
description: "A value of a label assigned to the record",
isRequired: false,
},
Expand All @@ -84,13 +84,6 @@ if authentication is enabled.
status: "200",
message: "OK",
summary: "The record is written",
description: (
<pre>
<code>{`{
// Response
}`}</code>
</pre>
),
},
{
status: "400",
Expand Down Expand Up @@ -165,3 +158,78 @@ Existing labels not mentioned in the request stay unchanged.
},
]}
/>

## Rename an Entry

To rename an entry, the request should have a JSON document with the new name.

If authentication is enabled, the method needs a valid API token with full access.

**Changes**:

- Version 1.12: The method was introduced.

<SwaggerComponent
method="PUT"
path="/api/v1/b/:bucket_name/:entry_name/rename"
summary="Rename an entry"
parameters={[
{
type: "path",
details: {
name: ":bucket_name",
description: "Name of bucket",
isRequired: true,
},
},
{
type: "path",
details: {
name: ":entry_name",
description: "Name of entry",
isRequired: true,
},
},
{
type: "body",
details: {
name: "new_name",
description: "New name of the entry",
dataType: "String",
isRequired: true,
},
},
]}
responses={[
{
status: "200",
message: "OK",
summary: "The entry is renamed",
},
{
status: "401",
message: "Unauthorized",
summary: "Access token is invalid or empty",
},
{
status: "403",
message: "Forbidden",
summary: "Access token doesn't have enough permissions",
},
{
status: "404",
message: "Not Found",
summary: "Bucket or entry doesn't exist",
},
{
status: "409",
message: "Conflict",
summary: "Entry with the new name already exists",
},
{
status: "422",
message: "Unprocessable Entity",
summary: "JSON request is invalid",
},
]}
/>
Loading