All URIs are relative to https://gateway.stackpath.com
Method | HTTP request | Description |
---|---|---|
CreateBucket | Post /storage/v1/stacks/{stack_id}/buckets | Create a bucket |
DeleteBucket | Delete /storage/v1/stacks/{stack_id}/buckets/{bucket_id} | Delete a bucket |
GetBucket | Get /storage/v1/stacks/{stack_id}/buckets/{bucket_id} | Get a bucket |
GetBuckets | Get /storage/v1/stacks/{stack_id}/buckets | Get all buckets |
UpdateBucket | Put /storage/v1/stacks/{stack_id}/buckets/{bucket_id} | Update a bucket |
StorageCreateBucketResponse CreateBucket(ctx, stackId).StorageCreateBucketRequest(storageCreateBucketRequest).Execute()
Create a bucket
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
stackId := "stackId_example" // string | A stack ID or slug
storageCreateBucketRequest := openapiclient.storageCreateBucketRequest{Label: "Label_example", Region: "Region_example"} // StorageCreateBucketRequest |
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.BucketsApi.CreateBucket(context.Background(), stackId, storageCreateBucketRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BucketsApi.CreateBucket``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateBucket`: StorageCreateBucketResponse
fmt.Fprintf(os.Stdout, "Response from `BucketsApi.CreateBucket`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
stackId | string | A stack ID or slug |
Other parameters are passed through a pointer to a apiCreateBucketRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
storageCreateBucketRequest | StorageCreateBucketRequest | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteBucket(ctx, stackId, bucketId).ForceDelete(forceDelete).Execute()
Delete a bucket
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
stackId := "stackId_example" // string | A stack ID or slug
bucketId := "bucketId_example" // string | A storage bucket ID
forceDelete := true // bool | Force bucket deletion even if there are contents inside it (optional)
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.BucketsApi.DeleteBucket(context.Background(), stackId, bucketId).ForceDelete(forceDelete).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BucketsApi.DeleteBucket``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
stackId | string | A stack ID or slug | |
bucketId | string | A storage bucket ID |
Other parameters are passed through a pointer to a apiDeleteBucketRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
forceDelete | bool | Force bucket deletion even if there are contents inside it |
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
StorageGetBucketResponse GetBucket(ctx, stackId, bucketId).Execute()
Get a bucket
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
stackId := "stackId_example" // string | A stack ID or slug
bucketId := "bucketId_example" // string | A storage bucket ID
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.BucketsApi.GetBucket(context.Background(), stackId, bucketId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BucketsApi.GetBucket``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetBucket`: StorageGetBucketResponse
fmt.Fprintf(os.Stdout, "Response from `BucketsApi.GetBucket`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
stackId | string | A stack ID or slug | |
bucketId | string | A storage bucket ID |
Other parameters are passed through a pointer to a apiGetBucketRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
StorageGetBucketsResponse GetBuckets(ctx, stackId).PageRequestFirst(pageRequestFirst).PageRequestAfter(pageRequestAfter).PageRequestFilter(pageRequestFilter).PageRequestSortBy(pageRequestSortBy).Execute()
Get all buckets
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
stackId := "stackId_example" // string | A stack ID or slug
pageRequestFirst := "pageRequestFirst_example" // string | The number of items desired. (optional)
pageRequestAfter := "pageRequestAfter_example" // string | The cursor value after which data will be returned. (optional)
pageRequestFilter := "pageRequestFilter_example" // string | SQL-style constraint filters. (optional)
pageRequestSortBy := "pageRequestSortBy_example" // string | Sort the response by the given field. (optional)
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.BucketsApi.GetBuckets(context.Background(), stackId).PageRequestFirst(pageRequestFirst).PageRequestAfter(pageRequestAfter).PageRequestFilter(pageRequestFilter).PageRequestSortBy(pageRequestSortBy).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BucketsApi.GetBuckets``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetBuckets`: StorageGetBucketsResponse
fmt.Fprintf(os.Stdout, "Response from `BucketsApi.GetBuckets`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
stackId | string | A stack ID or slug |
Other parameters are passed through a pointer to a apiGetBucketsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
pageRequestFirst | string | The number of items desired. | pageRequestAfter | string | The cursor value after which data will be returned. | pageRequestFilter | string | SQL-style constraint filters. | pageRequestSortBy | string | Sort the response by the given field. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
StorageUpdateBucketResponse UpdateBucket(ctx, stackId, bucketId).StorageUpdateBucketRequest(storageUpdateBucketRequest).Execute()
Update a bucket
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
stackId := "stackId_example" // string | A stack ID or slug
bucketId := "bucketId_example" // string | A storage bucket ID
storageUpdateBucketRequest := openapiclient.storageUpdateBucketRequest{Visibility: openapiclient.storageBucketVisibility{}} // StorageUpdateBucketRequest |
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.BucketsApi.UpdateBucket(context.Background(), stackId, bucketId, storageUpdateBucketRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BucketsApi.UpdateBucket``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateBucket`: StorageUpdateBucketResponse
fmt.Fprintf(os.Stdout, "Response from `BucketsApi.UpdateBucket`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
stackId | string | A stack ID or slug | |
bucketId | string | A storage bucket ID |
Other parameters are passed through a pointer to a apiUpdateBucketRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
storageUpdateBucketRequest | StorageUpdateBucketRequest | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]