Skip to content

Latest commit

 

History

History
413 lines (263 loc) · 12.9 KB

TlsCertificatesAPI.md

File metadata and controls

413 lines (263 loc) · 12.9 KB

TLSCertificatesAPI

Note

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

Method HTTP request Description
CreateTLSCert POST /tls/certificates Create a TLS certificate
DeleteTLSCert DELETE /tls/certificates/{tls_certificate_id} Delete a TLS certificate
GetTLSCert GET /tls/certificates/{tls_certificate_id} Get a TLS certificate
GetTLSCertBlob GET /tls/certificates/{tls_certificate_id}/blob Get a TLS certificate blob (Limited Availability)
ListTLSCerts GET /tls/certificates List TLS certificates
UpdateTLSCert PATCH /tls/certificates/{tls_certificate_id} Update a TLS certificate

CreateTLSCert

Create a TLS certificate

Example

package main

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

func main() {
    tlsCertificate := *openapiclient.NewTLSCertificate() // TLSCertificate |  (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
tlsCertificate TLSCertificate

Return type

map[string]any

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

DeleteTLSCert

Delete a TLS certificate

Example

package main

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

func main() {
    tlsCertificateID := "tlsCertificateId_example" // string | Alphanumeric string identifying a TLS certificate.

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

Other Parameters

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

GetTLSCert

Get a TLS certificate

Example

package main

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

func main() {
    tlsCertificateID := "tlsCertificateId_example" // string | Alphanumeric string identifying a TLS certificate.

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

TLSCertificateResponse

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

GetTLSCertBlob

Get a TLS certificate blob (Limited Availability)

Example

package main

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

func main() {
    tlsCertificateID := "tlsCertificateId_example" // string | Alphanumeric string identifying a TLS certificate.

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

TLSCertificateBlobResponse

Authorization

API Token

HTTP request headers

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

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

ListTLSCerts

List TLS certificates

Example

package main

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

func main() {
    filterInUse := "filterInUse_example" // string | Optional. Limit the returned certificates to those currently using Fastly to terminate TLS (that is, certificates associated with an activation). Permitted values: true, false. (optional)
    filterNotAfter := "filterNotAfter_example" // string | Limit the returned certificates to those that expire prior to the specified date in UTC. Accepts parameters: lte (e.g., filter[not_after][lte]=2020-05-05).  (optional)
    filterTLSDomainsID := "filterTLSDomainsId_example" // string | Limit the returned certificates to those that include the specific domain. (optional)
    include := "include_example" // string | Include related objects. Optional, comma-separated values. Permitted values: `tls_activations`.  (optional)
    sort := "sort_example" // string | The order in which to list the results. (optional) (default to "-created_at")
    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.TLSCertificatesAPI.ListTLSCerts(ctx).FilterInUse(filterInUse).FilterNotAfter(filterNotAfter).FilterTLSDomainsID(filterTLSDomainsID).Include(include).Sort(sort).PageNumber(pageNumber).PageSize(pageSize).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TLSCertificatesAPI.ListTLSCerts`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListTLSCerts`: TLSCertificatesResponse
    fmt.Fprintf(os.Stdout, "Response from `TLSCertificatesAPI.ListTLSCerts`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
filterInUse string Optional. Limit the returned certificates to those currently using Fastly to terminate TLS (that is, certificates associated with an activation). Permitted values: true, false. filterNotAfter

Return type

TLSCertificatesResponse

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

UpdateTLSCert

Update a TLS certificate

Example

package main

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

func main() {
    tlsCertificateID := "tlsCertificateId_example" // string | Alphanumeric string identifying a TLS certificate.
    tlsCertificate := *openapiclient.NewTLSCertificate() // TLSCertificate |  (optional)

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.TLSCertificatesAPI.UpdateTLSCert(ctx, tlsCertificateID).TLSCertificate(tlsCertificate).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `TLSCertificatesAPI.UpdateTLSCert`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateTLSCert`: TLSCertificateResponse
    fmt.Fprintf(os.Stdout, "Response from `TLSCertificatesAPI.UpdateTLSCert`: %v\n", resp)
}

Path Parameters

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

Other Parameters

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

Name Type Description Notes
tlsCertificate TLSCertificate

Return type

TLSCertificateResponse

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