Skip to content

Latest commit

 

History

History
323 lines (201 loc) · 7.3 KB

OTPsApi.md

File metadata and controls

323 lines (201 loc) · 7.3 KB

\OTPsApi

All URIs are relative to https://api.equinix.com/metal/v1

Method HTTP request Description
FindEnsureOtp Post /user/otp/verify/{otp} Verify user by providing an OTP
FindRecoveryCodes Get /user/otp/recovery-codes Retrieve my recovery codes
ReceiveCodes Post /user/otp/sms/receive Receive an OTP per sms
RegenerateCodes Post /user/otp/recovery-codes Generate new recovery codes
SeedApp Post /user/otp/app/receive Issue OTP seeds

FindEnsureOtp

FindEnsureOtp(ctx, otp).Execute()

Verify user by providing an OTP

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1"
)

func main() {
    otp := "otp_example" // string | OTP

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    r, err := apiClient.OTPsApi.FindEnsureOtp(context.Background(), otp).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `OTPsApi.FindEnsureOtp``: %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.
otp string OTP

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

x_auth_token

HTTP request headers

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

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

FindRecoveryCodes

RecoveryCodeList FindRecoveryCodes(ctx).Execute()

Retrieve my recovery codes

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

RecoveryCodeList

Authorization

x_auth_token

HTTP request headers

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

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

ReceiveCodes

ReceiveCodes(ctx).Execute()

Receive an OTP per sms

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

(empty response body)

Authorization

x_auth_token

HTTP request headers

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

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

RegenerateCodes

RecoveryCodeList RegenerateCodes(ctx).Execute()

Generate new recovery codes

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

RecoveryCodeList

Authorization

x_auth_token

HTTP request headers

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

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

SeedApp

OtpSeed SeedApp(ctx).Execute()

Issue OTP seeds

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

OtpSeed

Authorization

x_auth_token

HTTP request headers

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

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