Note
All URIs are relative to https://api.fastly.com
Method | HTTP request | Description |
---|---|---|
CreateServiceStar | POST /stars |
Create a star |
DeleteServiceStar | DELETE /stars/{star_id} |
Delete a star |
GetServiceStar | GET /stars/{star_id} |
Get a star |
ListServiceStars | GET /stars |
List stars |
Create a star
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
star := *openapiclient.NewStar() // Star | (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.StarAPI.CreateServiceStar(ctx).Star(star).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `StarAPI.CreateServiceStar`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateServiceStar`: StarResponse
fmt.Fprintf(os.Stdout, "Response from `StarAPI.CreateServiceStar`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiCreateServiceStarRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
star | Star |
- Content-Type: application/vnd.api+json
- Accept: application/vnd.api+json
Back to top | Back to API list | Back to README
Delete a star
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
starID := "starId_example" // string | Alphanumeric string identifying a star.
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.StarAPI.DeleteServiceStar(ctx, starID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `StarAPI.DeleteServiceStar`: %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. | |
starID | string | Alphanumeric string identifying a star. |
Other parameters are passed through a pointer to a apiDeleteServiceStarRequest 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
Get a star
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
starID := "starId_example" // string | Alphanumeric string identifying a star.
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.StarAPI.GetServiceStar(ctx, starID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `StarAPI.GetServiceStar`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetServiceStar`: StarResponse
fmt.Fprintf(os.Stdout, "Response from `StarAPI.GetServiceStar`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
starID | string | Alphanumeric string identifying a star. |
Other parameters are passed through a pointer to a apiGetServiceStarRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/vnd.api+json
Back to top | Back to API list | Back to README
List stars
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.StarAPI.ListServiceStars(ctx).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `StarAPI.ListServiceStars`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListServiceStars`: Pagination
fmt.Fprintf(os.Stdout, "Response from `StarAPI.ListServiceStars`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiListServiceStarsRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/vnd.api+json