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(ctx, otp).Execute()
Verify user by providing an OTP
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)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
otp | string | OTP |
Other parameters are passed through a pointer to a apiFindEnsureOtpRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RecoveryCodeList FindRecoveryCodes(ctx).Execute()
Retrieve my recovery codes
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)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiFindRecoveryCodesRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ReceiveCodes(ctx).Execute()
Receive an OTP per sms
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)
}
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiReceiveCodesRequest struct via the builder pattern
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RecoveryCodeList RegenerateCodes(ctx).Execute()
Generate new recovery codes
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)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiRegenerateCodesRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OtpSeed SeedApp(ctx).Execute()
Issue OTP seeds
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)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiSeedAppRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]