Skip to content

Latest commit

 

History

History
72 lines (45 loc) · 1.79 KB

SudoAPI.md

File metadata and controls

72 lines (45 loc) · 1.79 KB

SudoAPI

Note

All URIs are relative to https://api.fastly.com

Method HTTP request Description
RequestSudoAccess POST /sudo Request Sudo access

RequestSudoAccess

Request Sudo access

Example

package main

import (
    "context"
    "fmt"
    "os"
    "github.com/fastly/fastly-go/fastly"
)

func main() {
    sudoRequest := *openapiclient.NewSudoRequest("Username_example", "Password_example") // SudoRequest |  (optional)

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.SudoAPI.RequestSudoAccess(ctx).SudoRequest(sudoRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `SudoAPI.RequestSudoAccess`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `RequestSudoAccess`: SudoResponse
    fmt.Fprintf(os.Stdout, "Response from `SudoAPI.RequestSudoAccess`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
sudoRequest SudoRequest

Return type

SudoResponse

Authorization

API Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/vnd.api+json, application/problem+json

Back to top | Back to API list | Back to README