Skip to content

Latest commit

 

History

History
141 lines (88 loc) · 3.49 KB

StorageRegionsApi.md

File metadata and controls

141 lines (88 loc) · 3.49 KB

\StorageRegionsApi

All URIs are relative to https://api.cloudsmith.io/v1

Method HTTP request Description
StorageRegionsList Get /storage-regions/ Get a list of all available storage regions.
StorageRegionsRead Get /storage-regions/{slug}/ Get a specific storage region.

StorageRegionsList

[]StorageRegion StorageRegionsList(ctx).Execute()

Get a list of all available storage regions.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/cloudsmith-io/cloudsmith-api-go"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]StorageRegion

Authorization

apikey, basic

HTTP request headers

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

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

StorageRegionsRead

StorageRegion StorageRegionsRead(ctx, slug).Execute()

Get a specific storage region.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/cloudsmith-io/cloudsmith-api-go"
)

func main() {
	slug := "slug_example" // string | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
slug string

Other Parameters

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

Name Type Description Notes

Return type

StorageRegion

Authorization

apikey, basic

HTTP request headers

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

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