Note
All URIs are relative to https://api.fastly.com
Method | HTTP request | Description |
---|---|---|
CreateServerPool | POST /service/{service_id}/version/{version_id}/pool |
Create a server pool |
DeleteServerPool | DELETE /service/{service_id}/version/{version_id}/pool/{pool_name} |
Delete a server pool |
GetServerPool | GET /service/{service_id}/version/{version_id}/pool/{pool_name} |
Get a server pool |
ListServerPools | GET /service/{service_id}/version/{version_id}/pool |
List server pools |
UpdateServerPool | PUT /service/{service_id}/version/{version_id}/pool/{pool_name} |
Update a server pool |
Create a server pool
package main
import (
"context"
"fmt"
"os"
"time"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceID := "serviceId_example" // string | Alphanumeric string identifying the service.
versionID := int32(56) // int32 | Integer identifying a service version.
tlsCaCert := "tlsCaCert_example" // string | A secure certificate to authenticate a server with. Must be in PEM format. (optional) (default to "null")
tlsClientCert := "tlsClientCert_example" // string | The client certificate used to make authenticated requests. Must be in PEM format. (optional) (default to "null")
tlsClientKey := "tlsClientKey_example" // string | The client private key used to make authenticated requests. Must be in PEM format. (optional) (default to "null")
tlsCertHostname := "tlsCertHostname_example" // string | The hostname used to verify a server's certificate. It can either be the Common Name (CN) or a Subject Alternative Name (SAN). (optional) (default to "null")
useTLS := int32(56) // int32 | Whether to use TLS. (optional) (default to 0)
createdAt := time.Now() // time.Time | Date and time in ISO 8601 format. (optional)
deletedAt := time.Now() // time.Time | Date and time in ISO 8601 format. (optional)
updatedAt := time.Now() // time.Time | Date and time in ISO 8601 format. (optional)
serviceID2 := "serviceId_example" // string | (optional)
version := "version_example" // string | (optional)
name := "name_example" // string | Name for the Pool. (optional)
shield := "shield_example" // string | Selected POP to serve as a shield for the servers. Defaults to `null` meaning no origin shielding if not set. Refer to the [POPs API endpoint](https://www.fastly.com/documentation/reference/api/utils/pops/) to get a list of available POPs used for shielding. (optional) (default to "null")
requestCondition := "requestCondition_example" // string | Condition which, if met, will select this configuration during a request. Optional. (optional)
tlsCiphers := "tlsCiphers_example" // string | List of OpenSSL ciphers (see the [openssl.org manpages](https://www.openssl.org/docs/man1.1.1/man1/ciphers.html) for details). Optional. (optional)
tlsSniHostname := "tlsSniHostname_example" // string | SNI hostname. Optional. (optional)
minTLSVersion := int32(56) // int32 | Minimum allowed TLS version on connections to this server. Optional. (optional)
maxTLSVersion := int32(56) // int32 | Maximum allowed TLS version on connections to this server. Optional. (optional)
healthcheck := "healthcheck_example" // string | Name of the healthcheck to use with this pool. Can be empty and could be reused across multiple backend and pools. (optional)
comment := "comment_example" // string | A freeform descriptive note. (optional)
resourceType := "resourceType_example" // string | What type of load balance group to use. (optional)
overrideHost := "overrideHost_example" // string | The hostname to [override the Host header](https://docs.fastly.com/en/guides/specifying-an-override-host). Defaults to `null` meaning no override of the Host header will occur. This setting can also be added to a Server definition. If the field is set on a Server definition it will override the Pool setting. (optional) (default to "null")
betweenBytesTimeout := int32(56) // int32 | Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. If exceeded, the response received so far will be considered complete and the fetch will end. May be set at runtime using `bereq.between_bytes_timeout`. (optional) (default to 10000)
connectTimeout := int32(56) // int32 | How long to wait for a timeout in milliseconds. Optional. (optional)
firstByteTimeout := int32(56) // int32 | How long to wait for the first byte in milliseconds. Optional. (optional)
maxConnDefault := int32(56) // int32 | Maximum number of connections. Optional. (optional) (default to 200)
quorum := int32(56) // int32 | Percentage of capacity (`0-100`) that needs to be operationally available for a pool to be considered up. (optional) (default to 75)
tlsCheckCert := int32(56) // int32 | Be strict on checking TLS certs. Optional. (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.PoolAPI.CreateServerPool(ctx, serviceID, versionID).TLSCaCert(tlsCaCert).TLSClientCert(tlsClientCert).TLSClientKey(tlsClientKey).TLSCertHostname(tlsCertHostname).UseTLS(useTLS).CreatedAt(createdAt).DeletedAt(deletedAt).UpdatedAt(updatedAt).ServiceID2(serviceID2).Version(version).Name(name).Shield(shield).RequestCondition(requestCondition).TLSCiphers(tlsCiphers).TLSSniHostname(tlsSniHostname).MinTLSVersion(minTLSVersion).MaxTLSVersion(maxTLSVersion).Healthcheck(healthcheck).Comment(comment).ResourceType(resourceType).OverrideHost(overrideHost).BetweenBytesTimeout(betweenBytesTimeout).ConnectTimeout(connectTimeout).FirstByteTimeout(firstByteTimeout).MaxConnDefault(maxConnDefault).Quorum(quorum).TLSCheckCert(tlsCheckCert).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PoolAPI.CreateServerPool`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateServerPool`: PoolResponsePost
fmt.Fprintf(os.Stdout, "Response from `PoolAPI.CreateServerPool`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
serviceID | string | Alphanumeric string identifying the service. | |
versionID | int32 | Integer identifying a service version. |
Other parameters are passed through a pointer to a apiCreateServerPoolRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
tlsCaCert | string | A secure certificate to authenticate a server with. Must be in PEM format. | [default to "null"] tlsClientCert |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
Back to top | Back to API list | Back to README
Delete a server pool
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceID := "serviceId_example" // string | Alphanumeric string identifying the service.
versionID := int32(56) // int32 | Integer identifying a service version.
poolName := "poolName_example" // string | Name for the Pool.
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.PoolAPI.DeleteServerPool(ctx, serviceID, versionID, poolName).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PoolAPI.DeleteServerPool`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteServerPool`: InlineResponse200
fmt.Fprintf(os.Stdout, "Response from `PoolAPI.DeleteServerPool`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
serviceID | string | Alphanumeric string identifying the service. | |
versionID | int32 | Integer identifying a service version. | |
poolName | string | Name for the Pool. |
Other parameters are passed through a pointer to a apiDeleteServerPoolRequest 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
Get a server pool
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceID := "serviceId_example" // string | Alphanumeric string identifying the service.
versionID := int32(56) // int32 | Integer identifying a service version.
poolName := "poolName_example" // string | Name for the Pool.
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.PoolAPI.GetServerPool(ctx, serviceID, versionID, poolName).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PoolAPI.GetServerPool`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetServerPool`: PoolResponse
fmt.Fprintf(os.Stdout, "Response from `PoolAPI.GetServerPool`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
serviceID | string | Alphanumeric string identifying the service. | |
versionID | int32 | Integer identifying a service version. | |
poolName | string | Name for the Pool. |
Other parameters are passed through a pointer to a apiGetServerPoolRequest 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 server pools
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceID := "serviceId_example" // string | Alphanumeric string identifying the service.
versionID := int32(56) // int32 | Integer identifying a service version.
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.PoolAPI.ListServerPools(ctx, serviceID, versionID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PoolAPI.ListServerPools`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListServerPools`: []PoolResponse
fmt.Fprintf(os.Stdout, "Response from `PoolAPI.ListServerPools`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
serviceID | string | Alphanumeric string identifying the service. | |
versionID | int32 | Integer identifying a service version. |
Other parameters are passed through a pointer to a apiListServerPoolsRequest 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
Update a server pool
package main
import (
"context"
"fmt"
"os"
"time"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceID := "serviceId_example" // string | Alphanumeric string identifying the service.
versionID := int32(56) // int32 | Integer identifying a service version.
poolName := "poolName_example" // string | Name for the Pool.
tlsCaCert := "tlsCaCert_example" // string | A secure certificate to authenticate a server with. Must be in PEM format. (optional) (default to "null")
tlsClientCert := "tlsClientCert_example" // string | The client certificate used to make authenticated requests. Must be in PEM format. (optional) (default to "null")
tlsClientKey := "tlsClientKey_example" // string | The client private key used to make authenticated requests. Must be in PEM format. (optional) (default to "null")
tlsCertHostname := "tlsCertHostname_example" // string | The hostname used to verify a server's certificate. It can either be the Common Name (CN) or a Subject Alternative Name (SAN). (optional) (default to "null")
useTLS := int32(56) // int32 | Whether to use TLS. (optional) (default to 0)
createdAt := time.Now() // time.Time | Date and time in ISO 8601 format. (optional)
deletedAt := time.Now() // time.Time | Date and time in ISO 8601 format. (optional)
updatedAt := time.Now() // time.Time | Date and time in ISO 8601 format. (optional)
serviceID2 := "serviceId_example" // string | (optional)
version := "version_example" // string | (optional)
name := "name_example" // string | Name for the Pool. (optional)
shield := "shield_example" // string | Selected POP to serve as a shield for the servers. Defaults to `null` meaning no origin shielding if not set. Refer to the [POPs API endpoint](https://www.fastly.com/documentation/reference/api/utils/pops/) to get a list of available POPs used for shielding. (optional) (default to "null")
requestCondition := "requestCondition_example" // string | Condition which, if met, will select this configuration during a request. Optional. (optional)
tlsCiphers := "tlsCiphers_example" // string | List of OpenSSL ciphers (see the [openssl.org manpages](https://www.openssl.org/docs/man1.1.1/man1/ciphers.html) for details). Optional. (optional)
tlsSniHostname := "tlsSniHostname_example" // string | SNI hostname. Optional. (optional)
minTLSVersion := int32(56) // int32 | Minimum allowed TLS version on connections to this server. Optional. (optional)
maxTLSVersion := int32(56) // int32 | Maximum allowed TLS version on connections to this server. Optional. (optional)
healthcheck := "healthcheck_example" // string | Name of the healthcheck to use with this pool. Can be empty and could be reused across multiple backend and pools. (optional)
comment := "comment_example" // string | A freeform descriptive note. (optional)
resourceType := "resourceType_example" // string | What type of load balance group to use. (optional)
overrideHost := "overrideHost_example" // string | The hostname to [override the Host header](https://docs.fastly.com/en/guides/specifying-an-override-host). Defaults to `null` meaning no override of the Host header will occur. This setting can also be added to a Server definition. If the field is set on a Server definition it will override the Pool setting. (optional) (default to "null")
betweenBytesTimeout := int32(56) // int32 | Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. If exceeded, the response received so far will be considered complete and the fetch will end. May be set at runtime using `bereq.between_bytes_timeout`. (optional) (default to 10000)
connectTimeout := int32(56) // int32 | How long to wait for a timeout in milliseconds. Optional. (optional)
firstByteTimeout := int32(56) // int32 | How long to wait for the first byte in milliseconds. Optional. (optional)
maxConnDefault := int32(56) // int32 | Maximum number of connections. Optional. (optional) (default to 200)
quorum := int32(56) // int32 | Percentage of capacity (`0-100`) that needs to be operationally available for a pool to be considered up. (optional) (default to 75)
tlsCheckCert := int32(56) // int32 | Be strict on checking TLS certs. Optional. (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.PoolAPI.UpdateServerPool(ctx, serviceID, versionID, poolName).TLSCaCert(tlsCaCert).TLSClientCert(tlsClientCert).TLSClientKey(tlsClientKey).TLSCertHostname(tlsCertHostname).UseTLS(useTLS).CreatedAt(createdAt).DeletedAt(deletedAt).UpdatedAt(updatedAt).ServiceID2(serviceID2).Version(version).Name(name).Shield(shield).RequestCondition(requestCondition).TLSCiphers(tlsCiphers).TLSSniHostname(tlsSniHostname).MinTLSVersion(minTLSVersion).MaxTLSVersion(maxTLSVersion).Healthcheck(healthcheck).Comment(comment).ResourceType(resourceType).OverrideHost(overrideHost).BetweenBytesTimeout(betweenBytesTimeout).ConnectTimeout(connectTimeout).FirstByteTimeout(firstByteTimeout).MaxConnDefault(maxConnDefault).Quorum(quorum).TLSCheckCert(tlsCheckCert).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PoolAPI.UpdateServerPool`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateServerPool`: PoolResponse
fmt.Fprintf(os.Stdout, "Response from `PoolAPI.UpdateServerPool`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
serviceID | string | Alphanumeric string identifying the service. | |
versionID | int32 | Integer identifying a service version. | |
poolName | string | Name for the Pool. |
Other parameters are passed through a pointer to a apiUpdateServerPoolRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
tlsCaCert | string | A secure certificate to authenticate a server with. Must be in PEM format. | [default to "null"] tlsClientCert |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json