garage-admin-sdk-golang/docs/BucketApi.md

22 KiB

\BucketApi

All URIs are relative to http://localhost:3903/v0

Method HTTP request Description
AllowBucketKey Post /bucket/allow Allow key
CreateBucket Post /bucket Create a bucket
DeleteBucket Delete /bucket?id={bucket_id} Delete a bucket
DeleteBucketGlobalAlias Delete /bucket/alias/global Delete a global alias
DeleteBucketLocalAlias Delete /bucket/alias/local Delete a local alias
DenyBucketKey Post /bucket/deny Deny key
FindBucketInfo Get /bucket?globalAlias={alias} Find a bucket
GetBucketInfo Get /bucket?id={bucket_id} Get a bucket
ListBuckets Get /bucket List all buckets
PutBucketGlobalAlias Put /bucket/alias/global Add a global alias
PutBucketLocalAlias Put /bucket/alias/local Add a local alias
UpdateBucket Put /bucket?id={bucket_id} Update a bucket

AllowBucketKey

BucketInfo AllowBucketKey(ctx).AllowBucketKeyRequest(allowBucketKeyRequest).Execute()

Allow key

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    allowBucketKeyRequest := *openapiclient.NewAllowBucketKeyRequest("e6a14cd6a27f48684579ec6b381c078ab11697e6bc8513b72b2f5307e25fff9b", "GK31c2f218a2e44f485b94239e", *openapiclient.NewAllowBucketKeyRequestPermissions(true, true, true)) // AllowBucketKeyRequest | Aliases to put on the new bucket 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.BucketApi.AllowBucketKey(context.Background()).AllowBucketKeyRequest(allowBucketKeyRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.AllowBucketKey``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `AllowBucketKey`: BucketInfo
    fmt.Fprintf(os.Stdout, "Response from `BucketApi.AllowBucketKey`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiAllowBucketKeyRequest struct via the builder pattern

Name Type Description Notes
allowBucketKeyRequest AllowBucketKeyRequest Aliases to put on the new bucket

Return type

BucketInfo

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CreateBucket

BucketInfo CreateBucket(ctx).CreateBucketRequest(createBucketRequest).Execute()

Create a bucket

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    createBucketRequest := *openapiclient.NewCreateBucketRequest() // CreateBucketRequest | Aliases to put on the new bucket 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.BucketApi.CreateBucket(context.Background()).CreateBucketRequest(createBucketRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.CreateBucket``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CreateBucket`: BucketInfo
    fmt.Fprintf(os.Stdout, "Response from `BucketApi.CreateBucket`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCreateBucketRequest struct via the builder pattern

Name Type Description Notes
createBucketRequest CreateBucketRequest Aliases to put on the new bucket

Return type

BucketInfo

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteBucket

DeleteBucket(ctx, bucketId).Execute()

Delete a bucket

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    bucketId := "b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87" // string | The exact bucket identifier, a 32 bytes hexadecimal string

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.BucketApi.DeleteBucket(context.Background(), bucketId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.DeleteBucket``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
bucketId string The exact bucket identifier, a 32 bytes hexadecimal string

Other Parameters

Other parameters are passed through a pointer to a apiDeleteBucketRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteBucketGlobalAlias

BucketInfo DeleteBucketGlobalAlias(ctx).Id(id).Alias(alias).Execute()

Delete a global alias

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "e6a14cd6a27f48684579ec6b381c078ab11697e6bc8513b72b2f5307e25fff9b" // string | 
    alias := "my_documents" // string | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.BucketApi.DeleteBucketGlobalAlias(context.Background()).Id(id).Alias(alias).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.DeleteBucketGlobalAlias``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `DeleteBucketGlobalAlias`: BucketInfo
    fmt.Fprintf(os.Stdout, "Response from `BucketApi.DeleteBucketGlobalAlias`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiDeleteBucketGlobalAliasRequest struct via the builder pattern

Name Type Description Notes
id string
alias string

Return type

BucketInfo

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteBucketLocalAlias

BucketInfo DeleteBucketLocalAlias(ctx).Id(id).AccessKeyId(accessKeyId).Alias(alias).Execute()

Delete a local alias

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "e6a14cd6a27f48684579ec6b381c078ab11697e6bc8513b72b2f5307e25fff9b" // string | 
    accessKeyId := "GK31c2f218a2e44f485b94239e" // string | 
    alias := "my_documents" // string | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.BucketApi.DeleteBucketLocalAlias(context.Background()).Id(id).AccessKeyId(accessKeyId).Alias(alias).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.DeleteBucketLocalAlias``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `DeleteBucketLocalAlias`: BucketInfo
    fmt.Fprintf(os.Stdout, "Response from `BucketApi.DeleteBucketLocalAlias`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiDeleteBucketLocalAliasRequest struct via the builder pattern

Name Type Description Notes
id string
accessKeyId string
alias string

Return type

BucketInfo

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DenyBucketKey

BucketInfo DenyBucketKey(ctx).AllowBucketKeyRequest(allowBucketKeyRequest).Execute()

Deny key

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    allowBucketKeyRequest := *openapiclient.NewAllowBucketKeyRequest("e6a14cd6a27f48684579ec6b381c078ab11697e6bc8513b72b2f5307e25fff9b", "GK31c2f218a2e44f485b94239e", *openapiclient.NewAllowBucketKeyRequestPermissions(true, true, true)) // AllowBucketKeyRequest | Aliases to put on the new bucket 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.BucketApi.DenyBucketKey(context.Background()).AllowBucketKeyRequest(allowBucketKeyRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.DenyBucketKey``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `DenyBucketKey`: BucketInfo
    fmt.Fprintf(os.Stdout, "Response from `BucketApi.DenyBucketKey`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiDenyBucketKeyRequest struct via the builder pattern

Name Type Description Notes
allowBucketKeyRequest AllowBucketKeyRequest Aliases to put on the new bucket

Return type

BucketInfo

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FindBucketInfo

BucketInfo FindBucketInfo(ctx, alias).Execute()

Find a bucket

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    alias := "my_documents" // string | The exact global alias of one of the existing buckets

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.BucketApi.FindBucketInfo(context.Background(), alias).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.FindBucketInfo``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `FindBucketInfo`: BucketInfo
    fmt.Fprintf(os.Stdout, "Response from `BucketApi.FindBucketInfo`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
alias string The exact global alias of one of the existing buckets

Other Parameters

Other parameters are passed through a pointer to a apiFindBucketInfoRequest struct via the builder pattern

Name Type Description Notes

Return type

BucketInfo

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetBucketInfo

BucketInfo GetBucketInfo(ctx, bucketId).Execute()

Get a bucket

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    bucketId := "b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87" // string | The exact bucket identifier, a 32 bytes hexadecimal string

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.BucketApi.GetBucketInfo(context.Background(), bucketId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.GetBucketInfo``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetBucketInfo`: BucketInfo
    fmt.Fprintf(os.Stdout, "Response from `BucketApi.GetBucketInfo`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
bucketId string The exact bucket identifier, a 32 bytes hexadecimal string

Other Parameters

Other parameters are passed through a pointer to a apiGetBucketInfoRequest struct via the builder pattern

Name Type Description Notes

Return type

BucketInfo

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListBuckets

[]ListBuckets200ResponseInner ListBuckets(ctx).Execute()

List all buckets

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.BucketApi.ListBuckets(context.Background()).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.ListBuckets``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListBuckets`: []ListBuckets200ResponseInner
    fmt.Fprintf(os.Stdout, "Response from `BucketApi.ListBuckets`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiListBucketsRequest struct via the builder pattern

Return type

**[]ListBuckets200ResponseInner**

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PutBucketGlobalAlias

BucketInfo PutBucketGlobalAlias(ctx).Id(id).Alias(alias).Execute()

Add a global alias

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "e6a14cd6a27f48684579ec6b381c078ab11697e6bc8513b72b2f5307e25fff9b" // string | 
    alias := "my_documents" // string | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.BucketApi.PutBucketGlobalAlias(context.Background()).Id(id).Alias(alias).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.PutBucketGlobalAlias``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `PutBucketGlobalAlias`: BucketInfo
    fmt.Fprintf(os.Stdout, "Response from `BucketApi.PutBucketGlobalAlias`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPutBucketGlobalAliasRequest struct via the builder pattern

Name Type Description Notes
id string
alias string

Return type

BucketInfo

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PutBucketLocalAlias

BucketInfo PutBucketLocalAlias(ctx).Id(id).AccessKeyId(accessKeyId).Alias(alias).Execute()

Add a local alias

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "e6a14cd6a27f48684579ec6b381c078ab11697e6bc8513b72b2f5307e25fff9b" // string | 
    accessKeyId := "GK31c2f218a2e44f485b94239e" // string | 
    alias := "my_documents" // string | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.BucketApi.PutBucketLocalAlias(context.Background()).Id(id).AccessKeyId(accessKeyId).Alias(alias).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.PutBucketLocalAlias``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `PutBucketLocalAlias`: BucketInfo
    fmt.Fprintf(os.Stdout, "Response from `BucketApi.PutBucketLocalAlias`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPutBucketLocalAliasRequest struct via the builder pattern

Name Type Description Notes
id string
accessKeyId string
alias string

Return type

BucketInfo

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateBucket

BucketInfo UpdateBucket(ctx, bucketId).UpdateBucketRequest(updateBucketRequest).Execute()

Update a bucket

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    bucketId := "b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87" // string | The exact bucket identifier, a 32 bytes hexadecimal string
    updateBucketRequest := *openapiclient.NewUpdateBucketRequest() // UpdateBucketRequest | Requested changes on the bucket. Both root fields are optionals. 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.BucketApi.UpdateBucket(context.Background(), bucketId).UpdateBucketRequest(updateBucketRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.UpdateBucket``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateBucket`: BucketInfo
    fmt.Fprintf(os.Stdout, "Response from `BucketApi.UpdateBucket`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
bucketId string The exact bucket identifier, a 32 bytes hexadecimal string

Other Parameters

Other parameters are passed through a pointer to a apiUpdateBucketRequest struct via the builder pattern

Name Type Description Notes

updateBucketRequest | UpdateBucketRequest | Requested changes on the bucket. Both root fields are optionals. |

Return type

BucketInfo

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]