Skip to content

Latest commit

 

History

History
345 lines (221 loc) · 11.1 KB

TlsActivationsAPI.md

File metadata and controls

345 lines (221 loc) · 11.1 KB

TLSActivationsAPI

Note

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

Method HTTP request Description
CreateTLSActivation POST /tls/activations Enable TLS for a domain using a custom certificate
DeleteTLSActivation DELETE /tls/activations/{tls_activation_id} Disable TLS on a domain
GetTLSActivation GET /tls/activations/{tls_activation_id} Get a TLS activation
ListTLSActivations GET /tls/activations List TLS activations
UpdateTLSActivation PATCH /tls/activations/{tls_activation_id} Update a certificate

CreateTLSActivation

Enable TLS for a domain using a custom certificate

Example

package main

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

func main() {
    tlsActivation := *openapiclient.NewTLSActivation() // TLSActivation |  (optional)

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.TLSActivationsAPI.CreateTLSActivation(ctx).TLSActivation(tlsActivation).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TLSActivationsAPI.CreateTLSActivation`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CreateTLSActivation`: TLSActivationResponse
    fmt.Fprintf(os.Stdout, "Response from `TLSActivationsAPI.CreateTLSActivation`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
tlsActivation TLSActivation

Return type

TLSActivationResponse

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

DeleteTLSActivation

Disable TLS on a domain

Example

package main

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

func main() {
    tlsActivationID := "tlsActivationId_example" // string | Alphanumeric string identifying a TLS activation.

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.TLSActivationsAPI.DeleteTLSActivation(ctx, tlsActivationID).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TLSActivationsAPI.DeleteTLSActivation`: %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.
tlsActivationID string Alphanumeric string identifying a TLS activation.

Other Parameters

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

GetTLSActivation

Get a TLS activation

Example

package main

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

func main() {
    tlsActivationID := "tlsActivationId_example" // string | Alphanumeric string identifying a TLS activation.
    include := "tls_certificate,tls_configuration,tls_domain" // string | Include related objects. Optional, comma-separated values. Permitted values: `tls_certificate`, `tls_configuration`, and `tls_domain`.  (optional)

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes
include string Include related objects. Optional, comma-separated values. Permitted values: tls_certificate, tls_configuration, and tls_domain.

Return type

TLSActivationResponse

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

ListTLSActivations

List TLS activations

Example

package main

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

func main() {
    filterTLSCertificateID := "filterTLSCertificateId_example" // string | Limit the returned activations to a specific certificate. (optional)
    filterTLSConfigurationID := "filterTLSConfigurationId_example" // string | Limit the returned activations to a specific TLS configuration. (optional)
    filterTLSDomainID := "filterTLSDomainId_example" // string | Limit the returned rules to a specific domain name. (optional)
    include := "tls_certificate,tls_configuration,tls_domain" // string | Include related objects. Optional, comma-separated values. Permitted values: `tls_certificate`, `tls_configuration`, and `tls_domain`.  (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.TLSActivationsAPI.ListTLSActivations(ctx).FilterTLSCertificateID(filterTLSCertificateID).FilterTLSConfigurationID(filterTLSConfigurationID).FilterTLSDomainID(filterTLSDomainID).Include(include).PageNumber(pageNumber).PageSize(pageSize).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TLSActivationsAPI.ListTLSActivations`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListTLSActivations`: TLSActivationsResponse
    fmt.Fprintf(os.Stdout, "Response from `TLSActivationsAPI.ListTLSActivations`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
filterTLSCertificateID string Limit the returned activations to a specific certificate. filterTLSConfigurationID

Return type

TLSActivationsResponse

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

UpdateTLSActivation

Update a certificate

Example

package main

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

func main() {
    tlsActivationID := "tlsActivationId_example" // string | Alphanumeric string identifying a TLS activation.
    tlsActivation := *openapiclient.NewTLSActivation() // TLSActivation |  (optional)

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.TLSActivationsAPI.UpdateTLSActivation(ctx, tlsActivationID).TLSActivation(tlsActivation).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TLSActivationsAPI.UpdateTLSActivation`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateTLSActivation`: TLSActivationResponse
    fmt.Fprintf(os.Stdout, "Response from `TLSActivationsAPI.UpdateTLSActivation`: %v\n", resp)
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes
tlsActivation TLSActivation

Return type

TLSActivationResponse

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