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 |
Create a new dashboard
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)
}Other parameters are passed through a pointer to a apiCreateDashboardRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| createDashboardRequest | CreateDashboardRequest |
- Content-Type: application/json
- Accept: application/json
Back to top | Back to API list | Back to README
Delete an existing dashboard
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)
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| dashboardId | string |
Other parameters are passed through a pointer to a apiDeleteDashboardRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
Back to top | Back to API list | Back to README
Retrieve a dashboard by ID
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)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| dashboardId | string |
Other parameters are passed through a pointer to a apiGetDashboardRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
Back to top | Back to API list | Back to README
List all custom dashboards
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)
}This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiListDashboardsRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
Back to top | Back to API list | Back to README
Update an existing dashboard
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)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| dashboardId | string |
Other parameters are passed through a pointer to a apiUpdateDashboardRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| updateDashboardRequest | UpdateDashboardRequest |
- Content-Type: application/json
- Accept: application/json