Skip to content

Latest commit

 

History

History
336 lines (211 loc) · 8.95 KB

File metadata and controls

336 lines (211 loc) · 8.95 KB

ObservabilityCustomDashboardsAPI

Note

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

Method HTTP request Description
CreateDashboard POST /observability/dashboards Create a new dashboard
DeleteDashboard DELETE /observability/dashboards/{dashboard_id} Delete an existing dashboard
GetDashboard GET /observability/dashboards/{dashboard_id} Retrieve a dashboard by ID
ListDashboards GET /observability/dashboards List all custom dashboards
UpdateDashboard PATCH /observability/dashboards/{dashboard_id} Update an existing dashboard

CreateDashboard

Create a new dashboard

Example

package main

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

func main() {
    createDashboardRequest := *openapiclient.NewCreateDashboardRequest("Name_example") // CreateDashboardRequest |  (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
createDashboardRequest CreateDashboardRequest

Return type

Dashboard

Authorization

API Token

HTTP request headers

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

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

DeleteDashboard

Delete an existing dashboard

Example

package main

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

func main() {
    dashboardId := "2eGFXF4F4kTxd4gU39Bg3e" // string | 

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.ObservabilityCustomDashboardsAPI.DeleteDashboard(ctx, dashboardId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ObservabilityCustomDashboardsAPI.DeleteDashboard`: %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.
dashboardId string

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

API Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

GetDashboard

Retrieve a dashboard by ID

Example

package main

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

func main() {
    dashboardId := "2eGFXF4F4kTxd4gU39Bg3e" // string | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

Dashboard

Authorization

API Token

HTTP request headers

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

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

ListDashboards

List all custom dashboards

Example

package main

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

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

ListDashboardsResponse

Authorization

API Token

HTTP request headers

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

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

UpdateDashboard

Update an existing dashboard

Example

package main

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

func main() {
    dashboardId := "2eGFXF4F4kTxd4gU39Bg3e" // string | 
    updateDashboardRequest := *openapiclient.NewUpdateDashboardRequest() // UpdateDashboardRequest |  (optional)

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.ObservabilityCustomDashboardsAPI.UpdateDashboard(ctx, dashboardId).UpdateDashboardRequest(updateDashboardRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ObservabilityCustomDashboardsAPI.UpdateDashboard`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateDashboard`: Dashboard
    fmt.Fprintf(os.Stdout, "Response from `ObservabilityCustomDashboardsAPI.UpdateDashboard`: %v\n", resp)
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes
updateDashboardRequest UpdateDashboardRequest

Return type

Dashboard

Authorization

API Token

HTTP request headers

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

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