Skip to content

Latest commit

 

History

History
213 lines (138 loc) · 6.81 KB

TlsConfigurationsAPI.md

File metadata and controls

213 lines (138 loc) · 6.81 KB

TLSConfigurationsAPI

Note

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

Method HTTP request Description
GetTLSConfig GET /tls/configurations/{tls_configuration_id} Get a TLS configuration
ListTLSConfigs GET /tls/configurations List TLS configurations
UpdateTLSConfig PATCH /tls/configurations/{tls_configuration_id} Update a TLS configuration

GetTLSConfig

Get a TLS configuration

Example

package main

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

func main() {
    tlsConfigurationID := "tlsConfigurationId_example" // string | Alphanumeric string identifying a TLS configuration.
    include := "dns_records" // string | Include related objects. Optional, comma-separated values. Permitted values: `dns_records`.  (optional)

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
tlsConfigurationID string Alphanumeric string identifying a TLS configuration.

Other Parameters

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

Name Type Description Notes
include string Include related objects. Optional, comma-separated values. Permitted values: dns_records.

Return type

TLSConfigurationResponse

Authorization

API Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.api+json

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

ListTLSConfigs

List TLS configurations

Example

package main

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

func main() {
    filterBulk := "filterBulk_example" // string | Optionally filters by the bulk attribute. (optional)
    include := "dns_records" // string | Include related objects. Optional, comma-separated values. Permitted values: `dns_records`.  (optional)
    pageNumber := int32(1) // int32 | Current page. (optional)
    pageSize := int32(20) // int32 | Number of records per page. (optional) (default to 20)

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.TLSConfigurationsAPI.ListTLSConfigs(ctx).FilterBulk(filterBulk).Include(include).PageNumber(pageNumber).PageSize(pageSize).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TLSConfigurationsAPI.ListTLSConfigs`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListTLSConfigs`: TLSConfigurationsResponse
    fmt.Fprintf(os.Stdout, "Response from `TLSConfigurationsAPI.ListTLSConfigs`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
filterBulk string Optionally filters by the bulk attribute. include

Return type

TLSConfigurationsResponse

Authorization

API Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.api+json

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

UpdateTLSConfig

Update a TLS configuration

Example

package main

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

func main() {
    tlsConfigurationID := "tlsConfigurationId_example" // string | Alphanumeric string identifying a TLS configuration.
    tlsConfiguration := *openapiclient.NewTLSConfiguration() // TLSConfiguration |  (optional)

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
tlsConfigurationID string Alphanumeric string identifying a TLS configuration.

Other Parameters

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

Name Type Description Notes
tlsConfiguration TLSConfiguration

Return type

TLSConfigurationResponse

Authorization

API Token

HTTP request headers

  • Content-Type: application/vnd.api+json
  • Accept: application/vnd.api+json

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