Skip to content

Latest commit

 

History

History
227 lines (145 loc) · 6.18 KB

File metadata and controls

227 lines (145 loc) · 6.18 KB

\UserCredentialsApi

All URIs are relative to https://gateway.stackpath.com

Method HTTP request Description
DeleteCredential Delete /storage/v1/stacks/{stack_id}/users/{user_id}/credentials/{access_key} Delete credentials
GenerateCredentials Post /storage/v1/stacks/{stack_id}/users/{user_id}/credentials/generate Create credentials
GetCredentials Get /storage/v1/stacks/{stack_id}/users/{user_id}/credentials Get credentials

DeleteCredential

DeleteCredential(ctx, stackId, userId, accessKey).Execute()

Delete credentials

Example

package main

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

func main() {
    stackId := "stackId_example" // string | A stack ID or slug
    userId := "userId_example" // string | A user ID
    accessKey := "accessKey_example" // string | A user's access key

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.UserCredentialsApi.DeleteCredential(context.Background(), stackId, userId, accessKey).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `UserCredentialsApi.DeleteCredential``: %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.
stackId string A stack ID or slug
userId string A user ID
accessKey string A user's access key

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

oauth2

HTTP request headers

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

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

GenerateCredentials

StorageGenerateCredentialsResponse GenerateCredentials(ctx, stackId, userId).Execute()

Create credentials

Example

package main

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

func main() {
    stackId := "stackId_example" // string | A stack ID or slug
    userId := "userId_example" // string | A user ID

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.UserCredentialsApi.GenerateCredentials(context.Background(), stackId, userId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `UserCredentialsApi.GenerateCredentials``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GenerateCredentials`: StorageGenerateCredentialsResponse
    fmt.Fprintf(os.Stdout, "Response from `UserCredentialsApi.GenerateCredentials`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
stackId string A stack ID or slug
userId string A user ID

Other Parameters

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

Name Type Description Notes

Return type

StorageGenerateCredentialsResponse

Authorization

oauth2

HTTP request headers

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

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

GetCredentials

StorageGetCredentialsResponse GetCredentials(ctx, stackId, userId).Execute()

Get credentials

Example

package main

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

func main() {
    stackId := "stackId_example" // string | A stack ID or slug
    userId := "userId_example" // string | A user ID

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.UserCredentialsApi.GetCredentials(context.Background(), stackId, userId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `UserCredentialsApi.GetCredentials``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetCredentials`: StorageGetCredentialsResponse
    fmt.Fprintf(os.Stdout, "Response from `UserCredentialsApi.GetCredentials`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
stackId string A stack ID or slug
userId string A user ID

Other Parameters

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

Name Type Description Notes

Return type

StorageGetCredentialsResponse

Authorization

oauth2

HTTP request headers

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

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