Skip to content

Latest commit

 

History

History
546 lines (349 loc) · 15.6 KB

IamServiceGroupsAPI.md

File metadata and controls

546 lines (349 loc) · 15.6 KB

IamServiceGroupsAPI

Note

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

Method HTTP request Description
AddServiceGroupServices POST /service-groups/{service_group_id}/services Add services in a service group
CreateAServiceGroup POST /service-groups Create a service group
DeleteAServiceGroup DELETE /service-groups/{service_group_id} Delete a service group
GetAServiceGroup GET /service-groups/{service_group_id} Get a service group
ListServiceGroupServices GET /service-groups/{service_group_id}/services List services to a service group
ListServiceGroups GET /service-groups List service groups
RemoveServiceGroupServices DELETE /service-groups/{service_group_id}/services Remove services from a service group
UpdateAServiceGroup PATCH /service-groups/{service_group_id} Update a service group

AddServiceGroupServices

Add services in a service group

Example

package main

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

func main() {
    serviceGroupID := "serviceGroupId_example" // string | Alphanumeric string identifying the service group.
    requestBody := map[string]map[string]any{"key": map[string]any(123)} // map[string]map[string]any |  (optional)

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.IamServiceGroupsAPI.AddServiceGroupServices(ctx, serviceGroupID).RequestBody(requestBody).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `IamServiceGroupsAPI.AddServiceGroupServices`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `AddServiceGroupServices`: map[string]any
    fmt.Fprintf(os.Stdout, "Response from `IamServiceGroupsAPI.AddServiceGroupServices`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
serviceGroupID string Alphanumeric string identifying the service group.

Other Parameters

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

Name Type Description Notes
requestBody map[string]map[string]any

Return type

map[string]any

Authorization

API Token

HTTP request headers

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

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

CreateAServiceGroup

Create a service group

Example

package main

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

func main() {
    requestBody := map[string]map[string]any{"key": map[string]any(123)} // map[string]map[string]any |  (optional)

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.IamServiceGroupsAPI.CreateAServiceGroup(ctx).RequestBody(requestBody).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `IamServiceGroupsAPI.CreateAServiceGroup`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CreateAServiceGroup`: map[string]any
    fmt.Fprintf(os.Stdout, "Response from `IamServiceGroupsAPI.CreateAServiceGroup`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
requestBody map[string]map[string]any

Return type

map[string]any

Authorization

API Token

HTTP request headers

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

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

DeleteAServiceGroup

Delete a service group

Example

package main

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

func main() {
    serviceGroupID := "serviceGroupId_example" // string | Alphanumeric string identifying the service group.

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.IamServiceGroupsAPI.DeleteAServiceGroup(ctx, serviceGroupID).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `IamServiceGroupsAPI.DeleteAServiceGroup`: %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.
serviceGroupID string Alphanumeric string identifying the service group.

Other Parameters

Other parameters are passed through a pointer to a apiDeleteAServiceGroupRequest 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

GetAServiceGroup

Get a service group

Example

package main

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

func main() {
    serviceGroupID := "serviceGroupId_example" // string | Alphanumeric string identifying the service group.

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.IamServiceGroupsAPI.GetAServiceGroup(ctx, serviceGroupID).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `IamServiceGroupsAPI.GetAServiceGroup`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetAServiceGroup`: map[string]any
    fmt.Fprintf(os.Stdout, "Response from `IamServiceGroupsAPI.GetAServiceGroup`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
serviceGroupID string Alphanumeric string identifying the service group.

Other Parameters

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

Name Type Description Notes

Return type

map[string]any

Authorization

API Token

HTTP request headers

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

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

ListServiceGroupServices

List services to a service group

Example

package main

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

func main() {
    serviceGroupID := "serviceGroupId_example" // string | Alphanumeric string identifying the service group.
    perPage := int32(20) // int32 | Number of records per page. (optional) (default to 20)
    page := int32(1) // int32 | Current page. (optional)

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.IamServiceGroupsAPI.ListServiceGroupServices(ctx, serviceGroupID).PerPage(perPage).Page(page).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `IamServiceGroupsAPI.ListServiceGroupServices`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListServiceGroupServices`: map[string]any
    fmt.Fprintf(os.Stdout, "Response from `IamServiceGroupsAPI.ListServiceGroupServices`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
serviceGroupID string Alphanumeric string identifying the service group.

Other Parameters

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

Name Type Description Notes
perPage int32 Number of records per page. [default to 20] page

Return type

map[string]any

Authorization

API Token

HTTP request headers

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

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

ListServiceGroups

List service groups

Example

package main

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

func main() {
    perPage := int32(20) // int32 | Number of records per page. (optional) (default to 20)
    page := int32(1) // int32 | Current page. (optional)

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.IamServiceGroupsAPI.ListServiceGroups(ctx).PerPage(perPage).Page(page).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `IamServiceGroupsAPI.ListServiceGroups`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListServiceGroups`: map[string]any
    fmt.Fprintf(os.Stdout, "Response from `IamServiceGroupsAPI.ListServiceGroups`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
perPage int32 Number of records per page. [default to 20] page

Return type

map[string]any

Authorization

API Token

HTTP request headers

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

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

RemoveServiceGroupServices

Remove services from a service group

Example

package main

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

func main() {
    serviceGroupID := "serviceGroupId_example" // string | Alphanumeric string identifying the service group.
    requestBody := map[string]map[string]any{"key": map[string]any(123)} // map[string]map[string]any |  (optional)

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.IamServiceGroupsAPI.RemoveServiceGroupServices(ctx, serviceGroupID).RequestBody(requestBody).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `IamServiceGroupsAPI.RemoveServiceGroupServices`: %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.
serviceGroupID string Alphanumeric string identifying the service group.

Other Parameters

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

Name Type Description Notes
requestBody map[string]map[string]any

Return type

(empty response body)

Authorization

API Token

HTTP request headers

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

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

UpdateAServiceGroup

Update a service group

Example

package main

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

func main() {
    serviceGroupID := "serviceGroupId_example" // string | Alphanumeric string identifying the service group.
    requestBody := map[string]map[string]any{"key": map[string]any(123)} // map[string]map[string]any |  (optional)

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.IamServiceGroupsAPI.UpdateAServiceGroup(ctx, serviceGroupID).RequestBody(requestBody).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `IamServiceGroupsAPI.UpdateAServiceGroup`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateAServiceGroup`: map[string]any
    fmt.Fprintf(os.Stdout, "Response from `IamServiceGroupsAPI.UpdateAServiceGroup`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
serviceGroupID string Alphanumeric string identifying the service group.

Other Parameters

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

Name Type Description Notes
requestBody map[string]map[string]any

Return type

map[string]any

Authorization

API Token

HTTP request headers

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

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